Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Commit 2019-02-15 - Love++ for strings of documentation.
  • cxxomfort: Improved code documentation.
  • cxxomfort: Added Doxygen-generated documentation (see below).
  • memory: Added detection of shared_ptr and other <tr1/memory> utilities for GCC.
  • string: Added missing output operator to std::string under Watcom (enhances: [b8ea55b791]).
  • string: Added to_string support under Watcom (enhances: [b8ea55b791]).
  • string: Added to_string support under MSVC 2005.
  • typeindex: Added minimum std::type_index support under Watcom (enhances: [b8ea55b791]).
  • typeindex: Added minimum std::type_index support under MSVC 2005.

Starting this revision cxxomfort offers a copy of the Doxygen generated documentation for the interfaces via unversioned files. The contents are reachable via /uv/html/.

While compilers like MSVC 2005 and OpenWatcom do not have TR1 and thus are not supported, the current build organizes things so that more of the core features can be used before a hard fail. In particular, byte, declval, string_view, to_string and in the future in a limited manner reference_wrapper, errc and unique_ptr should be at least minimally usable.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:b1a27cd47b9a66ba17aedd14ba0c5927a2bdb1643420a01fe8ddd1f5073eabf1
User & Date: luismachuca 2019-02-16 04:45:04
Context
2019-02-20
13:34
Commit 2019-02-20 - Minor documentation updates.
  • cxxomfort: Updated /doc/trunk/cxxomfort/LICENSE.txt.
  • cxxomfort: Deprecated some extras/ headers.
  • cxxomfort: Removed the extras/ headers for array_ref, foreach, forward_list and optional.
check-in: 65b214ce user: luismachuca tags: trunk, y2019
2019-02-16
04:45
Commit 2019-02-15 - Love++ for strings of documentation.
  • cxxomfort: Improved code documentation.
  • cxxomfort: Added Doxygen-generated documentation (see below).
  • memory: Added detection of shared_ptr and other <tr1/memory> utilities for GCC.
  • string: Added missing output operator to std::string under Watcom (enhances: [b8ea55b791]).
  • string: Added to_string support under Watcom (enhances: [b8ea55b791]).
  • string: Added to_string support under MSVC 2005.
  • typeindex: Added minimum std::type_index support under Watcom (enhances: [b8ea55b791]).
  • typeindex: Added minimum std::type_index support under MSVC 2005.

Starting this revision cxxomfort offers a copy of the Doxygen generated documentation for the interfaces via unversioned files. The contents are reachable via /uv/html/.

While compilers like MSVC 2005 and OpenWatcom do not have TR1 and thus are not supported, the current build organizes things so that more of the core features can be used before a hard fail. In particular, byte, declval, string_view, to_string and in the future in a limited manner reference_wrapper, errc and unique_ptr should be at least minimally usable. check-in: b1a27cd4 user: luismachuca tags: trunk

2019-02-14
17:51
Commit 2019-02-14 - Minor fixes.
  • cxxomfort: Fixed version values.
  • config: Added detection values for type-related compiler intrinsics.
check-in: 6530abeb user: luismachuca tags: trunk, y2019
Changes

Changes to cxxomfort/CHANGELOG.txt.























1
2
3
4
5
6
7






















Commit 2019-02-14 - Minor fixes.

  *  cxxomfort: Fixed version values.
  *  config: Added detection values for type-related compiler intrinsics.


Commit 2019-02-13 - <tt>Love--</tt> for OpenWatcom; various minor fixes.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Commit 2019-02-15 - <tt>Love++</tt> for strings of documentation.

  *  cxxomfort: Improved code documentation.
  *  cxxomfort: Added Doxygen-generated documentation (see below).
  *  memory: Added detection of shared_ptr and other <tt><tr1/memory></tt> utilities for GCC.
  *  string: Added missing output operator to <tt>std::string</tt> under Watcom (enhances: [b8ea55b791]).
  *  string: Added to_string support under Watcom (enhances: [b8ea55b791]).
  *  string: Added to_string support under MSVC 2005.
  *  typeindex: Added minimum <tt>std::type_index</tt> support under Watcom (enhances: [b8ea55b791]).
  *  typeindex: Added minimum <tt>std::type_index</tt> support under MSVC 2005.

Starting this revision cxxomfort offers a copy of the 
Doxygen generated documentation for the interfaces via unversioned files. 
The contents are reachable via <b>[/uv/html/]</b>.

While compilers like MSVC 2005 and OpenWatcom do not have TR1 and thus 
are not supported, the current build organizes things so that more of the 
core features can be used before a hard fail. In particular, 
<tt>byte</tt>, <tt> declval</tt>, <tt>string_view</tt>, <tt>to_string</tt> and in the future in a limited manner <tt>reference_wrapper</tt>, <tt>errc</tt> and <tt>unique_ptr</tt> 
should be at least minimally usable.


Commit 2019-02-14 - Minor fixes.

  *  cxxomfort: Fixed version values.
  *  config: Added detection values for type-related compiler intrinsics.


Commit 2019-02-13 - <tt>Love--</tt> for OpenWatcom; various minor fixes.

Changes to cxxomfort/cxxomfort/base/move.hpp.

59
60
61
62
63
64
65
66

67
68
69
70
71
72
73
#endif

#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
#pragma message CXXO_NOTICE("enabled rvref and movable object emulation.")
#endif

#if (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_OW,<9999))
    #include "move-00.hpp" // basically "does-nothing" move


#elif !defined (CXXOMFORT_USING_MOVE_EMULATION)
    #include "move-11.hpp"
    // end c++11
#else
    #include "move-03.hpp"
// end c++11 / c++03







|
>







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#endif

#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
#pragma message CXXO_NOTICE("enabled rvref and movable object emulation.")
#endif

#if (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_OW,<9999))
    //#include "move-00.hpp" // basically "does-nothing" move
    //#include "move-03.hpp"

#elif !defined (CXXOMFORT_USING_MOVE_EMULATION)
    #include "move-11.hpp"
    // end c++11
#else
    #include "move-03.hpp"
// end c++11 / c++03

Changes to cxxomfort/cxxomfort/config.hpp.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
...
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
...
427
428
429
430
431
432
433

434


435

436


437
438
439
440
441
442
443
444
445
446
447
448
...
482
483
484
485
486
487
488


489

490















491
492



























493
 * @ingroup cxxomfort-config
 *
 * This file contains configuration macros used by the cxxomfort library
 * and it is not intended to be directly used.
 */

//! Library version and release date as YYYYMMDD
#define CXXOMFORT_DATE 20190213UL
//! Defines the library version 
//! @warning to be deprecated
#define CXXOMFORT_VERSION 92

//#include "config/_version.hpp" // (WARNING: to be deprecated)
#include "config/_pre.hpp"

#include "config/_support.hpp"


/*
 * Behaviour macros
 */

................................................................................
#endif


// 
// Code Generation
// 

/* 
 * CXXO_TYPEOF
 * 
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_decltype)
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(...) decltype(__VA_ARGS__)
#elif (CXXO_COMPILER_SUPPORT_typeof && !defined(CXXO_TYPEOF))
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(...) __typeof__(__VA_ARGS__)
#elif (!defined(CXXO_TYPEOF))
	// a shot in the dark?
	#define CXXO_TYPEOF(expr) cxxo_typeof_not_available_t 
#endif


//
// ---------------------------------------------------------
//

#include "config/_codegen.hpp"
#include "config/_has.hpp"
................................................................................

//! The default namespace of C++ Standard stuff.
namespace std {}
//! Namespace of the @c cxxomfort library.
namespace cxxomfort {
//! Namespace that holds the library's backports of named C++ features.
namespace cxxostd {}

//! Namespace that holds fixes and alternative names for stuff in C++ std that can not be modified.


namespace fix {}

//! Namespace that holds the library's own implementations, emulations and supplements.


namespace library {}

//! Information about the library support
//! @ingroup cxxomfort-config
// some old compilers don't grok initializers for empty structs it seems.
#if defined(CXXOFLAG_NO_INITIALIZERS)
struct info {
#else
const struct info { 
#endif
    enum {
    //! library version
................................................................................
// ~::cxxomfort
}

/**
 * @page cxxomfort-config
 * @brief Configuration macros
 * 


 *

 * 















 */




























#endif







|


|

<

<







 







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







>
|
>
>

>
|
>
>




<







 







>
>
|
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

6
7
8
9
10
11
12
13
14
15
16
17

18

19
20
21
22
23
24
25
...
332
333
334
335
336
337
338















339
340
341
342
343
344
345
...
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429

430
431
432
433
434
435
436
...
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
 * @ingroup cxxomfort-config
 *
 * This file contains configuration macros used by the cxxomfort library
 * and it is not intended to be directly used.
 */

//! Library version and release date as YYYYMMDD
#define CXXOMFORT_DATE 20190215UL
//! Defines the library version 
//! @warning to be deprecated
#define CXXOMFORT_VERSION 93


#include "config/_pre.hpp"

#include "config/_support.hpp"


/*
 * Behaviour macros
 */

................................................................................
#endif


// 
// Code Generation
// 

















//
// ---------------------------------------------------------
//

#include "config/_codegen.hpp"
#include "config/_has.hpp"
................................................................................

//! The default namespace of C++ Standard stuff.
namespace std {}
//! Namespace of the @c cxxomfort library.
namespace cxxomfort {
//! Namespace that holds the library's backports of named C++ features.
namespace cxxostd {}
/** 
 * Namespace that holds fixes and alternative names for stuff in C++ std that can not be modified.
 * @ingroup cxxomfort-fix
 * */
namespace fix {}
/**
 * Namespace that holds the library's own implementations, emulations and supplements.
 * @ingroup cxxo-sup
 * */
namespace library {}

//! Information about the library support
//! @ingroup cxxomfort-config

#if defined(CXXOFLAG_NO_INITIALIZERS)
struct info {
#else
const struct info { 
#endif
    enum {
    //! library version
................................................................................
// ~::cxxomfort
}

/**
 * @page cxxomfort-config
 * @brief Configuration macros
 * 
 * This section describes the various values that provide information 
 * about cxxomfort and the values they can take.
 * 
 * **Version information**:
 * 
 * * @c CXXOMFORT_DATE - date of release.
 * * @c CXXOMFORT_VERSION - version number.
 * * @c CXXOMFORT_CXX_STD - the year of the C++ Standard running in the compiler.
 * * @c CXXOMFORT_CXX_EMULATION - the year of the standard emulated by the compiler.
 * 
 * **Informative macros**:
 * 
 * * @c CXXOMFORT_NOTICES - enables diagnostic messages.
 * * @c CXXO_namespace_tr1 - has the name of the namespace where TR1 names live.
 * 
 * 
 * **Code Generation**:
 * 
 * See @ref cxxomfort-codegen .
 * 
 */

/**
 * @page cxxomfort-fix
 * @brief Fixes to features in @c std 
 * 
 * Some features in <tt>namespace std</tt> are implemented with issues or 
 * in unusable fashion in some compilers, and as such cxxomfort can not reuse the names.
 * 
 * To deal with this, namespace <code>cxxomfort::fix</code> offers a number of 
 * alternatives or "forwarders" for the features in namespace std. These 
 * features either redirect to the @c std one if it's working, or to an implementation 
 * in cxxomfort when they are not.
 * 
 * Examples of features here:
 * 
 * * @link cxxomfort::cxxostd::to_byte() @c to_byte() @endlink - 
 * allows construction of a @c std::byte value pre-C++14 where uniform initialization 
 * is not available, as @c std::byte has no value-taking constructors.
 * 
 * * @c @ref cxxomfort::fix::hash hash<> - An extended, extensible version of 
 * @c std::hash from <tt><functional></tt> that forwards to the std one but also 
 * allows implementing extended specializations based on type_traits, etc. 
 * In cxxomfort it is used primarily to provide <tt>hash<enum type></tt>.
 * 
 * 
 * */


#endif

Changes to cxxomfort/cxxomfort/config/_codegen.hpp.

4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52

53
54
55
56
57
58
59
..
72
73
74
75
76
77
78


79











80































































































81




















































#ifndef CXXOMFORT_CONFIG_CODEGEN_HPP
#define CXXOMFORT_CONFIG_CODEGEN_HPP
/**
 * @file
 * @brief Code generation macros and utilities.
 */



/**
 * @def CXXO_DEFAULT_DEFAULT_CONSTRUCTOR
 * @ingroup cxxomfort-codegen
 * Macros for generating code snippers that change between C++ versions 
 * for particular types of members.
 * Examples: default-ctors, trivial copy-ctors, default assignment, etc.
 * 
 * */
#if (CXXOMFORT_CXX_STD >= 2011 || \
(CXXO_COMPILER_SUPPORT_default_delete && CXXO_COMPILER_SUPPORT_noexcept))
    #define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () = default
#else
    #define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () throw() {} 
#endif

................................................................................
#if (CXXOMFORT_CXX_STD >= 2011 || \
(CXXO_COMPILER_SUPPORT_default_delete && CXXO_COMPILER_SUPPORT_noexcept))
	#define CXXO_DELETED_DEFAUT_CONSTRUCTOR(Type) Type () noexcept = delete
#else
	#define CXXO_DELETED_DEFAUT_CONSTRUCTOR(Type) private: Type() 
#endif

/**
 * @def CXXO_DEFAULT_COPY_CONSTRUCTOR
 * @ingroup cxxomfort-codegen
 * @brief Announces a default copy constructor.
 * @param Su constructor suffix (eg.: noexcept)
 * @param ... Explicit constructor body (for C++03)
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) \
    Type (Type const& ) Su = default 
#else 

    #define CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) \
    Type (Type const& From) Su \
    : __VA_ARGS__ {} 
#endif


/**
 * @def CXXO_DELETED_COPY_CONSTRUCTOR

 * @ingroup cxxomfort-codegen
 * @brief Announces a deleted (unavailable) copy constructor.
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) Type (Type const&) = delete
    #define CXXO_DELETED_COPY_ASSIGN(Type) Type& operator= (Type const&) = delete
#else
................................................................................
#else
    #define CXXO_ENABLEIF_TEMPLATE() 
    #define CXXO_ENABLEIF_FUNCTION() \
    , typename std::enable_if< CXXO_SIGCONDITION >::type * = nullptr 
    
#endif















































































































#endif



























































>

<
<
<
<
<
<
|
<







 







<
<
<
<
<
<
<




>








>







 







>
>
|
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
4
5
6
7
8
9
10
11
12






13

14
15
16
17
18
19
20
..
21
22
23
24
25
26
27







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
#ifndef CXXOMFORT_CONFIG_CODEGEN_HPP
#define CXXOMFORT_CONFIG_CODEGEN_HPP
/**
 * @file
 * @brief Code generation macros and utilities.
 */

#ifndef DOXYGEN_DOC









#if (CXXOMFORT_CXX_STD >= 2011 || \
(CXXO_COMPILER_SUPPORT_default_delete && CXXO_COMPILER_SUPPORT_noexcept))
    #define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () = default
#else
    #define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () throw() {} 
#endif

................................................................................
#if (CXXOMFORT_CXX_STD >= 2011 || \
(CXXO_COMPILER_SUPPORT_default_delete && CXXO_COMPILER_SUPPORT_noexcept))
	#define CXXO_DELETED_DEFAUT_CONSTRUCTOR(Type) Type () noexcept = delete
#else
	#define CXXO_DELETED_DEFAUT_CONSTRUCTOR(Type) private: Type() 
#endif








#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) \
    Type (Type const& ) Su = default 
#else 
	//! @internal
    #define CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) \
    Type (Type const& From) Su \
    : __VA_ARGS__ {} 
#endif


/**
 * @def CXXO_DELETED_COPY_CONSTRUCTOR
 * @brief Declares a "<tt>=delete</tt>" copy constructor.
 * @ingroup cxxomfort-codegen
 * @brief Announces a deleted (unavailable) copy constructor.
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) Type (Type const&) = delete
    #define CXXO_DELETED_COPY_ASSIGN(Type) Type& operator= (Type const&) = delete
#else
................................................................................
#else
    #define CXXO_ENABLEIF_TEMPLATE() 
    #define CXXO_ENABLEIF_FUNCTION() \
    , typename std::enable_if< CXXO_SIGCONDITION >::type * = nullptr 
    
#endif

/* 
 * CXXO_TYPEOF
 * 
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_decltype)
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(...) decltype(__VA_ARGS__)
#elif (CXXO_COMPILER_SUPPORT_typeof && !defined(CXXO_TYPEOF))
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(...) __typeof__(__VA_ARGS__)
#elif (!defined(CXXO_TYPEOF))
	// a shot in the dark?
	#define CXXO_TYPEOF(expr) cxxo_typeof_not_available_t 
#endif



#else
	//
	// documentation section
	//

#define CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Type) Type () = default [or equivalent]

#define CXXO_DEFAULT_COPY_CONSTRUCTOR(Type, Su, ...) \
    [if >=C++11] Type (Type const& ) Su = default  \
    [else] Type (Type const& From) Su  : __VA_ARGS__ {} 

#define CXXO_DELETED_DEFAUT_CONSTRUCTOR(Type) Type () noexcept = delete [or equivalent]

#define CXXO_TYPEOF(expr) __typeof__(expr) [or equivalent]

/**
 * @def CXXO_DEFAULT_DEFAULT_CONSTRUCTOR
 * @brief Declares a “ <tt>=default</tt> ” default constructor.
 * @ingroup cxxomfort-codegen
 * @xrefitem cxxomfort-codegen "Codegen" "default-ctor"
 * 
 * Using this macro in the body of a class will invoke, where available, 
 * the <tt>=default</tt> default constructor. In pre-C++11, it will invoke 
 * a <tt>throw()</tt> empty constructor.
 * 
 * @code
 * class Foo {
 * 		CXXO_DEFAULT_DEFAULT_CONSTRUCTOR(Foo);
 * 		//In >= C++11 equivalent to:
 * 		Foo () noexcept = default;
 * 
 * };
 * @endcode
 * 
 * */

/**
 * @def CXXO_DEFAULT_COPY_CONSTRUCTOR
 * @brief Declares a <tt>=default</tt> copy constructor.
 * @ingroup cxxomfort-codegen
 * @param Su constructor suffix (eg.: noexcept)
 * @param ... Explicit constructor body (for C++03)
 * @xrefitem cxxomfort-codegen "Codegen" "copy-ctor"
 * 
 * Using this macro in the body of a class invokes, starting with C++11, 
 * a <tt>=default</tt> copy constructor. In C++03, it generates the code 
 * for a copy constructor using the subsequent arguments to the macro 
 * as code for the member initializer list, using the variable name 
 * <tt>From</tt> for the <b>argument</b> of the copy constructor.
 * 
 * @code
 * class Foo {
 * 		CXXO_DEFAULT_COPY_CONSTRUCTOR(Foo,  , member(From.member) );
 * 		//In >= C++11 equivalent to:
 * 		Foo (Foo const&)  = default;
 * 		//In < C++11 equivalent to:
 * 		Foo (Foo const& From) : member(From.member) {}
 * 
 * 		private:
 * 		float member;
 * 
 * };
 * @endcode
 * 
 * */


/**
 * @def CXXO_DELETED_DEFAULT_CONSTRUCTOR
 * @brief Declares a <tt>=delete</tt> default constructor.
 * @ingroup cxxomfort-codegen
 * @xrefitem cxxomfort-codegen "Codegen" "default-ctor"
 * 
 * Using this macro in the body of a class <tt>Foo</tt> 
 * declares the default constructor (<tt>Foo ();</tt>) 
 * as <tt>=delete</tt>-d or unavailable.
 * 
 * */


/**
 * @def CXXO_TYPEOF
 * @brief Obtains the type of @a expr if there is a <tt>__typeof__</tt>-like facility to do so.
 * @ingroup cxxomfort-codegen
 * @param expr An expression evaluating to a type. Since this is a macro, it can't take commas.
 * 
 * In C++11 onwards, this evaluates to <tt>decltype(expr)</tt> ; in other modes, 
 * it will ealuate to <tt>__typeof__(expr)</tt> if the feature is available or will 
 * error out if not.
 * 
 * 
 * */

#endif


#endif

/**
 * @page cxxomfort-codegen Code Generation
 * @brief Describes cxxomfort macros for code generation.
 * 
 * 
 * Cxxomfort includes a number of macros that help generating code.
 * 
 * <b>For generating code for types and classes</b>:
 * 
 * * @c @ref CXXO_DEFAULT_DEFAULT_CONSTRUCTOR() - declares a class's 
 * default constructor as <tt>=default</tt> (or a close equivalent in pre-C++11).
 * * @c @ref CXXO_DELETED_DEFAULT_CONSTRUCTOR() - declares a class's 
 * default constructor as <tt>=delete</tt> (or a close equivalent in pre-C++11).
 * * @c @ref CXXO_DEFAULT_COPY_CONSTRUCTOR() - declares a class's 
 * default copy constructor as <tt>=default</tt> (or implements an alternative pre-C++11).
 * * @c @ref CXXO_DELETED_COPY_CONSTRUCTOR() - declares a class's 
 * default copy constructor as <tt>=delete</tt>-d (or a close equivalent pre-C++11).
 * 
 * <b>For generating functions</b>:
 * 
 * Including <code>#include <cxxomfort/base.hpp></code> (explicitly or implicitly) gives access to the following macros:
 * 
 * * @c CXXO_COPYABLE_AND_MOVABLE(classname) - declare a class as copyable and movable, native in C++11 or using move-emulation in C++03.
 * 
 * Including <code>#include <cxxomfort/impl/relationals.hpp></code> gives access to the following feature:
 * 
 * * <tt>CXXO_GENERATE_RELATIONALS(classname)</tt>: automatically generate non-member 
 * relational operators <tt>> , >=, <=, !=</tt> for a class that already implements 
 * operators <tt>== , <</tt>. 
 * 
 * 
 * <b>For evaluating expressions</b>:
 * 
 * * @ref <tt>CXXO_TYPEOF()</tt> - determines the type of an expression if the compiler has the capability.
 * * @ref <tt>CXXO_DECLTYPE()</tt> - determines the type of an expression in C++11-onwards mode.
 * 
 * Including <code>#include <cxxomfort/library/i12n.hpp></code> (explicitly or implicitly) gives 
 * access to @link cxxo-i12n the sequence intialization helper macros @endlink :
 * 
 * * @c @ref CXXO_I12N_BEG
 * * @c @ref CXXO_I12N_END
 * * @c @ref CXXO_I12N_SEQ
 * 
 * 
 * 
 * 
 * 
 * */

Changes to cxxomfort/cxxomfort/config/ow.hpp.

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

// integer types are available in native cstdint

// explicit cast... do templates work?

#endif // 9999

#if (__WATCOMC__ > 1200) // Watcom 1.9 or higher
    #undef  CXXO_COMPILER_SUPPORT_cstd_cstdint
    #define CXXO_COMPILER_SUPPORT_cstd_cstdint 1

#endif

#if (__WATCOMC__ > 1300) // Watcom 2.0 / OpenWatcom or higher
#endif

#endif







|





|



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92

// integer types are available in native cstdint

// explicit cast... do templates work?

#endif // 9999

#if (__WATCOMC__ >= 1200) // Watcom 1.9 or higher
    #undef  CXXO_COMPILER_SUPPORT_cstd_cstdint
    #define CXXO_COMPILER_SUPPORT_cstd_cstdint 1

#endif

#if (__WATCOMC__ >= 1300) // Watcom 2.0 / OpenWatcom or higher
#endif

#endif

Changes to cxxomfort/cxxomfort/cxxomfort.hpp.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
73
74
75
 * @brief Backports library for C++.
 * @author Luis Machuca Bezzaza <luis [dot] machuca [at] gulix [dot] cl>
 * @license MIT License (see LICENSE.txt)
 * @mainpage Cxxomfort Backport Tools for C++.
 *
 * Cxxomfort is a small, header-only library that backports nifty features and goodies from C++11 and later versions to previous versions such as C++03, as well as featuring some proposals still in the works. It was written to facilitate working with the evolving C++ Standard when I was coming back to the language during the C++11 transition, as well as reduce stress of code rewrite while at the same time assisting in backwards and forwards portability.
 * 
 * This is a help page compiled from the official cxxomfort sources, built using 
 * <a href="http://www.doxygen.nl/" target="_blank">Doxygen</a>. 
 * Information on features and usage of cxxomfort is available 
 * at the repository's page:
 *
 * http://ryan.gulix.cl/fossil.cgi/cxxomfort
 *
 * 
 * <table><tr>
 *  <th>Library</th>
 *  <td align="center"> @subpage cxxomfort-behaviour "Configuration Macros" - @subpage cxxomfort-info "Informative Variables" 
 *  </td>
 * </tr><tr>
 *  <th>Basic features</th>
 *  <td align="center"> @subpage cxxomfort-base "Base Features (automatically included)" -- @cxxowiki{Features,repo} <br/>
 * <code>#include <cxxomfort/base.hpp></code><br/>
 *  @c nullptr , @c static_assert , @c explicit_cast , @c move / rvalue-reference emulation , iterator accessors
 *  </td>
 * </tr><tr>
 *  <th rowspan="2">Backports & Standard&nbsp;C++</th>

 *  <td align="center">  <tt>#include <cxxomfort/backports.hpp></tt><br/>
 *  <strong>Backports</strong> @cxxowiki{Features,repo}
 *  <br/> @subpage cxx03-backports "C++03" -- @subpage cxx11-backports "C++11" --  @subpage cxx14-backports "C++14" -- @subpage cxx17-backports "C++17" --  @subpage cxx20-backports "C++20?"
 *  </td>
 *  </tr><tr><td align="center">
 * @subpage std0cstddef "<cstddef>" - @subpage std0cstdint "<cstdint>" - <cstdio> - @subpage std0cuchar "<cuchar>" 
 <br/> @subpage std0algorithm "<algorithm>" - @subpage std0functional "<functional>" -  @subpage std0iterator "<iterator>" - @subpage std0numeric "<numeric>" - @subpage std0string "<string>" - @subpage std0string_view "<string_view>" 
 <br/> @subpage std0limits "<limits>" - @subpage std0memory "<memory>" - @subpage std0tuple "<tuple>" - @subpage std0utility "<utility>" 
 <br/> @subpage std0type_traits "<type_traits>" - @subpage std0typeindex "<typeindex>" 
 <br/> @subpage std0array "<array>" - @subpage std0forward_list "<forward_list>" 
 <br/> @subpage std0random "<random>" - @subpage std0system_error "<system_error>"
 * <br/>  @subpage transparent-headers "Transparent Headers" -- @subpage cxxomfort-fixes "Fixes to implementation issues"
 * </td>
 *  </tr>
 * </tr><tr>
 *  <th rowspan="2">Supplements</th>
 * <td align="center">
 *  @subpage cxxo-sup "Library Supplements" -- @cxxowiki{Supplements,repo}</a> 
 *  <br/> <tt>#include <cxxomfort/library.hpp></tt>
................................................................................
 *  <br/>
 * @ref cxxo-foreach "@c foreach emulation" -- typesafe @c enums -- strong types -- @link cxxo-i12n @c i12n (initialization) @endlink 
 * <br/>
 * @c @ref array_ref -- @c @ref fixed_vector -- @c @ref mstack 
 * <br/>
 * Supplementals for Standard C++ Headers
 * </td></tr>
 * <tr><td>  @cxxowiki{Extras,Extra Projects}</a>
 * </td></tr>
 * </table>
 * 
 *
 * <table>
 * <tr><th colspan="9"> Installation and Usage </th></tr>
 * <tr><td> <a href="http://ryan.gulix.cl/fossil.cgi/cxxomfort/wiki?name=Installation">Installation</a>  </td>

 *  <td> <a href="http://ryan.gulix.cl/fossil.cgi/cxxomfort/wiki?name=Configuration">Configuration</a> </td>
 *  <td> @subpage cxxomfort-usage "Usage" </td>
 *  <th> @subpage cxxomfort-isr "Implementation Status" </th>
 * </tr>
 * </table>
 * 
 * 
 * <h2>Licensing Terms</h2>
 * 
 * This library is distributed under the terms of the







|
|
|
|






|



|

|



>
|
<
|








|







 







|






|
>
|
<
<







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67


68
69
70
71
72
73
74
 * @brief Backports library for C++.
 * @author Luis Machuca Bezzaza <luis [dot] machuca [at] gulix [dot] cl>
 * @license MIT License (see LICENSE.txt)
 * @mainpage Cxxomfort Backport Tools for C++.
 *
 * Cxxomfort is a small, header-only library that backports nifty features and goodies from C++11 and later versions to previous versions such as C++03, as well as featuring some proposals still in the works. It was written to facilitate working with the evolving C++ Standard when I was coming back to the language during the C++11 transition, as well as reduce stress of code rewrite while at the same time assisting in backwards and forwards portability.
 * 
 * This is a precompiled help built using 
 * <a href="http://www.doxygen.nl/" target="_blank">Doxygen</a> and covers only 
 * the published interfaces (names, functions, etc) and their usage; for 
 * information on installation and configuration, check the repository's page:
 *
 * http://ryan.gulix.cl/fossil.cgi/cxxomfort
 *
 * 
 * <table><tr>
 *  <th>Library</th>
 *  <td align="center"> @subpage cxxomfort-behaviour "Behaviour Macros" - @subpage cxxomfort-codegen "Code Generation" 
 *  </td>
 * </tr><tr>
 *  <th>Basic features</th>
 *  <td align="center"> @subpage cxxomfort-base "Base Features (automatically included)" <br/>
 * <code>#include <cxxomfort/base.hpp></code><br/>
 *  @c @ref nullptr , @c @ref static_assert , @c @ref explicit_cast , @c move / rvalue-reference emulation , iterator accessors , alignof
 *  </td>
 * </tr><tr>
 *  <th rowspan="2">Backports & Standard&nbsp;C++</th>
 *  <td align="center"> *  <strong>Backports</strong> 
 *  <tt>#include <cxxomfort/backports.hpp></tt><br/>

 *  @subpage cxx03-backports "C++03" -- @subpage cxx11-backports "C++11" --  @subpage cxx14-backports "C++14" -- @subpage cxx17-backports "C++17" --  @subpage cxx20-backports "C++20?"
 *  </td>
 *  </tr><tr><td align="center">
 * @subpage std0cstddef "<cstddef>" - @subpage std0cstdint "<cstdint>" - <cstdio> - @subpage std0cuchar "<cuchar>" 
 <br/> @subpage std0algorithm "<algorithm>" - @subpage std0functional "<functional>" -  @subpage std0iterator "<iterator>" - @subpage std0numeric "<numeric>" - @subpage std0string "<string>" - @subpage std0string_view "<string_view>" 
 <br/> @subpage std0limits "<limits>" - @subpage std0memory "<memory>" - @subpage std0tuple "<tuple>" - @subpage std0utility "<utility>" 
 <br/> @subpage std0type_traits "<type_traits>" - @subpage std0typeindex "<typeindex>" 
 <br/> @subpage std0array "<array>" - @subpage std0forward_list "<forward_list>" 
 <br/> @subpage std0random "<random>" - @subpage std0system_error "<system_error>"
 * <br/>  @subpage transparent-headers "Transparent Headers" -- @subpage cxxomfort-fix "Fixes to implementation issues"
 * </td>
 *  </tr>
 * </tr><tr>
 *  <th rowspan="2">Supplements</th>
 * <td align="center">
 *  @subpage cxxo-sup "Library Supplements" -- @cxxowiki{Supplements,repo}</a> 
 *  <br/> <tt>#include <cxxomfort/library.hpp></tt>
................................................................................
 *  <br/>
 * @ref cxxo-foreach "@c foreach emulation" -- typesafe @c enums -- strong types -- @link cxxo-i12n @c i12n (initialization) @endlink 
 * <br/>
 * @c @ref array_ref -- @c @ref fixed_vector -- @c @ref mstack 
 * <br/>
 * Supplementals for Standard C++ Headers
 * </td></tr>
 * <tr><td style="text-align:center;">  @cxxowiki{Extras,Extra Projects}</a>
 * </td></tr>
 * </table>
 * 
 *
 * <table>
 * <tr><th colspan="9"> Installation and Usage </th></tr>
 * <tr><td> @cxxowiki{Installation,Installation}   </td>
 *  <td> @cxxowiki{Configuration,Configuration} </td>
 *  <td> <a href="http://ryan.gulix.cl/fossil.cgi/cxxomfort/ticket" target="_blank">Tickets & Reports</a>


 * </tr>
 * </table>
 * 
 * 
 * <h2>Licensing Terms</h2>
 * 
 * This library is distributed under the terms of the

Changes to cxxomfort/cxxomfort/docgen/isr.hpp.

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

/**
 * @page cxx17-backports C++17 Backports
 * @brief Backports from C++17.
 * 
 * A listing of some of the features backported:
 * 
 * * From the language proper: @c @ref byte  . 
 * * From <tt><algorithm></tt>: @c clamp() .
 * * From <tt><cstddef></tt>: @c to_integral() .
 * * From <tt><functional></tt>: @c not_fn() .
 * * From @link std0iterator <tt><iterator></tt> @endlink : container data globals @c data() , @c size() , @c empty() . 
 * * From <tt><numeric></tt>: @c gcd() , @c lcm() .
 * * From <tt><tuple></tt>: @c make_from_tuple() , @c apply() .
 * * From <tt><type_traits></tt>: @c @ref make_void , @c @ref void_t , @c bool_constant , etc.







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

/**
 * @page cxx17-backports C++17 Backports
 * @brief Backports from C++17.
 * 
 * A listing of some of the features backported:
 * 
 * * From the language proper: @link cxxomfort::cxxostd::byte @c std::byte @endlink (see also @c to_byte() )  . 
 * * From <tt><algorithm></tt>: @c clamp() .
 * * From <tt><cstddef></tt>: @c to_integral() .
 * * From <tt><functional></tt>: @c not_fn() .
 * * From @link std0iterator <tt><iterator></tt> @endlink : container data globals @c data() , @c size() , @c empty() . 
 * * From <tt><numeric></tt>: @c gcd() , @c lcm() .
 * * From <tt><tuple></tt>: @c make_from_tuple() , @c apply() .
 * * From <tt><type_traits></tt>: @c @ref make_void , @c @ref void_t , @c bool_constant , etc.

Changes to cxxomfort/cxxomfort/impl/11-to_string.hpp.

4
5
6
7
8
9
10

11
12
13
14
15
16
17
...
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
 * @file
 * @brief Implementation for std::to_string and allies 
 * @xrefitem std0string "<string>"
 *
 */

#include <cxxomfort/base.hpp>

#include <cxxomfort/util/type_traits.hpp> // is_arithmetic w/o C++11 dependency
#include <string>
#include <cstdio>
#include <cstdlib>
#include <stdlib.h> // for MSVC?
#include <stdexcept>
#include <limits>
................................................................................
namespace detail_string {



template <typename Integral> struct fn_s_to_i {};
template <> struct fn_s_to_i<unsigned long> {
    typedef unsigned long (*fn_t)(const char*, char**, int);
    static fn_t fn () { return strtoul; }
};
template <> struct fn_s_to_i<unsigned long long> {
    typedef unsigned long long (*fn_t)(const char*, char**, int);
#ifdef _MSC_VER
    static fn_t fn () { return _strtoui64; }
#else
    static fn_t fn () { return strtoull; }
#endif
};
template <> struct fn_s_to_i<signed long> {
    typedef signed long (*fn_t)(const char*, char**, int);
    static fn_t fn () { return strtol; }
};
template <> struct fn_s_to_i<signed long long> {
    typedef signed long long (*fn_t)(const char*, char**, int);
#ifdef _MSC_VER
    static fn_t fn () { return _strtoi64; }
#else
    static fn_t fn () { return strtoll; }
#endif
};


template <typename Integral> struct  string_to_integral {
    typedef Integral(*convertfn)(const char*, char**, int);








>







 







|




|

|




|




|

|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
 * @file
 * @brief Implementation for std::to_string and allies 
 * @xrefitem std0string "<string>"
 *
 */

#include <cxxomfort/base.hpp>
#include <cxxomfort/cstdint.hpp>
#include <cxxomfort/util/type_traits.hpp> // is_arithmetic w/o C++11 dependency
#include <string>
#include <cstdio>
#include <cstdlib>
#include <stdlib.h> // for MSVC?
#include <stdexcept>
#include <limits>
................................................................................
namespace detail_string {



template <typename Integral> struct fn_s_to_i {};
template <> struct fn_s_to_i<unsigned long> {
    typedef unsigned long (*fn_t)(const char*, char**, int);
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return strtoul; }
};
template <> struct fn_s_to_i<unsigned long long> {
    typedef unsigned long long (*fn_t)(const char*, char**, int);
#ifdef _MSC_VER
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return _strtoui64; }
#else
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return strtoull; }
#endif
};
template <> struct fn_s_to_i<signed long> {
    typedef signed long (*fn_t)(const char*, char**, int);
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return strtol; }
};
template <> struct fn_s_to_i<signed long long> {
    typedef signed long long (*fn_t)(const char*, char**, int);
#ifdef _MSC_VER
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return _strtoi64; }
#else
    static fn_t fn () CXXO_NOEXCEPTNOTHROW { return strtoll; }
#endif
};


template <typename Integral> struct  string_to_integral {
    typedef Integral(*convertfn)(const char*, char**, int);

Added cxxomfort/cxxomfort/impl/11-to_string.pre97.hpp.







































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef CXXOMFORT_IMPL_TO_STRING_PRE97_HPP
#define CXXOMFORT_IMPL_TO_STRING_PRE97_HPP
/**
 * @file
 * @brief Implementation for std::to_string and allies 
 * @xrefitem std0string "<string>"
 *
 */

#include <cxxomfort/base.hpp>
#include <cxxomfort/cstdint.hpp>
#include <cxxomfort/util/type_traits.hpp> // is_arithmetic w/o C++11 dependency
#include <string>
#include <cstdio>
#include <cstdlib>
#include <stdlib.h> // for MSVC?
#include <stdexcept>
#include <limits>
#include <vector>
#include <cerrno>

namespace cxxomfort { namespace cxxostd {

static std::string to_string (int u) {
	using namespace std;
	char buff[20]= {0};
	sprintf(buff,"%d",u);
	return std::string(buff);
}

static std::string to_string (unsigned int u) {
	using namespace std;
	char buff[20]= {0};
	sprintf(buff,"%u",u);
	return std::string(buff);
}

static std::string to_string (long int l) {
	using namespace std;
	char buff[30]= {0};
	sprintf(buff,"%ld",l);
	return std::string(buff);
}

static std::string to_string (long unsigned l) {
	using namespace std;
	char buff[30]= {0};
	sprintf(buff,"%lu",l);
	return std::string(buff);
}


static std::string to_string (double f) {
	using namespace std;
	char buff[64]= {0};
	sprintf(buff,"%f",f);
	return std::string(buff);
}


} }

namespace std {
	using cxxomfort::cxxostd::to_string;
}

#endif

Changes to cxxomfort/cxxomfort/impl/14-make_unique.hpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CXXOMFORT_IMPL_MAKE_UNIQUE_HPP
#define CXXOMFORT_IMPL_MAKE_UNIQUE_HPP
/**
 * @file
 */
#include "../base.hpp"
#include "../impl/unique_ptr.hpp"

#define CXXOMFORT_IMPLEMENTS_n3588 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_make_unique CXXOMFORT_IMPLEMENTS_n3588


// this is included after unique_ptr







|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef CXXOMFORT_IMPL_MAKE_UNIQUE_HPP
#define CXXOMFORT_IMPL_MAKE_UNIQUE_HPP
/**
 * @file
 */
#include "../base.hpp"
//#include "../impl/unique_ptr.hpp"

#define CXXOMFORT_IMPLEMENTS_n3588 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_make_unique CXXOMFORT_IMPLEMENTS_n3588


// this is included after unique_ptr

Changes to cxxomfort/cxxomfort/impl/17-bool_constant.hpp.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define CXXOMFORT_IMPL_17_BOOLEANCONSTANT_HPP
/**
 * @file
 * @brief Implementation of std::bool_constant 
 */
#include <cxxomfort/base.hpp>
#include <cxxomfort/type_traits.hpp>
#include <type_traits>

#define CXXOMFORT_IMPLEMENTS_n4334 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_bool_constant CXXOMFORT_IMPLEMENTS_n4334

#if (defined(CXXOMFORT_NOTICES))
    #if (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled boolean_constant implementation")







|







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define CXXOMFORT_IMPL_17_BOOLEANCONSTANT_HPP
/**
 * @file
 * @brief Implementation of std::bool_constant 
 */
#include <cxxomfort/base.hpp>
#include <cxxomfort/type_traits.hpp>
//#include <type_traits>

#define CXXOMFORT_IMPLEMENTS_n4334 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_bool_constant CXXOMFORT_IMPLEMENTS_n4334

#if (defined(CXXOMFORT_NOTICES))
    #if (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled boolean_constant implementation")

Changes to cxxomfort/cxxomfort/impl/17-byte.hpp.

166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
...
281
282
283
284
285
286
287









































288
289
290
291
292
293
294
...
300
301
302
303
304
305
306
307

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

331
332
333
334
335
336
337
338
339
340
341
342
343
	using namespace std;
	return explicit_cast<unsigned char>(b);
	//I i= 0;
	//memcpy(&i, &b, 1);
	//return i;
}

#if (CXXOMFORT_CXX_STD>=1997)
template <typename I>
byte to_byte (I i) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	byte b;
	unsigned char c= static_cast<unsigned char>(i);
	memcpy(&b, &c, 1);
	return b;
}
#else
static inline 
byte to_byte (unsigned u) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	byte b;
	memcpy(&b,&u,1);
	return b;
}

#endif


} } // cxxomfort::cxxostd


#endif

................................................................................
}



} } 











































// 
// using 
// 

#if (defined(CXXOFLAG_NO_STD_USING) && CXXOFLAG_NO_STD_USING>0 )
#elif (CXXOMFORT_IMPLEMENTS_byte==CXXO_IMPLSTATUS_NATIVE())
#else
................................................................................
#endif


namespace cxxomfort { namespace fix {

/**
 * @brief Construct a 'byte' value from an integer.
 * @ingroup cxx17-backports

 */
	using cxxomfort::cxxostd::to_byte;

} } // cxxomfort::fix

#if (defined(DOXYGEN_DOC))
namespace std {
/**
 * @class byte
 * @brief "byte" type for C++17.
 * @ingroup cxx17-backports
 * @xrefitem std0cstddef "<cstddef>" "std::byte"
 * @see http://wg21.link/p0298r3
 * @see https://en.cppreference.com/w/cpp/types/byte
 * @anchor std_byte
 * 
 * A '<code>byte</code>' is much like an <code>unsigned char</code>, 
 * except that it is not an integral type or a character type, 
 * but a trivial-like type of its own. 
 * It represents one @e character in memory in terms of a sequence of bits.
 * 
 * Only bit operations (via bitmask operators) and explicit integral 
 * transformations are defined for it.

 * 
 * The following basic operations are allowed:
 * 
 * @code
 * byte b = to_byte(0xnn);
 * byte c = from_underlying<byte>(0xnn)
 * b | c;
 * b & c;
 * b ^ c;
 * b >>= 2;
 * c <<= 3;
 * c= ~b;
 * int cint = to_integer<int>(c);







|








<
<
<
<
<
<
<
<
<
<







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







|
>








|





<

<
<
<
<
<
<
<
>





<







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181










182
183
184
185
186
187
188
...
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
...
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353

354







355
356
357
358
359
360

361
362
363
364
365
366
367
	using namespace std;
	return explicit_cast<unsigned char>(b);
	//I i= 0;
	//memcpy(&i, &b, 1);
	//return i;
}


template <typename I>
byte to_byte (I i) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	byte b;
	unsigned char c= static_cast<unsigned char>(i);
	memcpy(&b, &c, 1);
	return b;
}












} } // cxxomfort::cxxostd


#endif

................................................................................
}



} } 


#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {

/**
 * @brief Type that represents a "byte" with a value.
 * @ingroup cxx17-backports 
 * 
 * A '<code>byte</code>' is much like an <code>unsigned char</code>, 
 * except that it is not an integral type or a character type, 
 * but a trivial-like type of its own. 
 * It represents one @e character in memory in terms of a sequence of bits.
 * 
 * Only bit operations (via bitmask operators) and explicit 
 * conversion to <tt>unsigned char</tt> are defined for it.
 * 
 * @c byte has no value-taking constructors. In order to construct a value 
 * of type @c byte one uses the assist function @c to_byte() .
 * 
 * See @c @ref std::byte for more information.
 * */
struct byte {
	__implementation_defined_t value;
};

/**
 * @brief Creates a @c std::byte value given a numerical octet value.
 * @ingroup cxxomfort-fix
 * @xrefitem cxxomfort-fix "byte" "byte"
 * @return A @c std::byte value .
 * 
 * 
 * See @c std::byte for more information.
 * */
template <typename Integral>
inline to_byte (Integral i) CXXO_NOEXCEPTNOTHROW {
	return byte{i};
}

} }
#endif

// 
// using 
// 

#if (defined(CXXOFLAG_NO_STD_USING) && CXXOFLAG_NO_STD_USING>0 )
#elif (CXXOMFORT_IMPLEMENTS_byte==CXXO_IMPLSTATUS_NATIVE())
#else
................................................................................
#endif


namespace cxxomfort { namespace fix {

/**
 * @brief Construct a 'byte' value from an integer.
 * @ingroup cxxomfort-fix
 * 
 */
	using cxxomfort::cxxostd::to_byte;

} } // cxxomfort::fix

#if (defined(DOXYGEN_DOC))
namespace std {
/**
 * @enum byte
 * @brief "byte" type for C++17.
 * @ingroup cxx17-backports
 * @xrefitem std0cstddef "<cstddef>" "std::byte"
 * @see http://wg21.link/p0298r3
 * @see https://en.cppreference.com/w/cpp/types/byte

 * 







 * cxxomfort provides this backport via @c @ref cxxomfort::cxxostd::byte .
 * 
 * The following basic operations are allowed:
 * 
 * @code
 * byte b = to_byte(0xnn);

 * b | c;
 * b & c;
 * b ^ c;
 * b >>= 2;
 * c <<= 3;
 * c= ~b;
 * int cint = to_integer<int>(c);

Changes to cxxomfort/cxxomfort/impl/functionmeta.hpp.

1
2
3
4
5
6
7
8
9
10
11
..
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
...
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
...
130
131
132
133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
150
151
152
153
154
155
156

157
158
159

160
161
162
163
164
165
166
167
168
169
170
171

172

173
174
175
176
177
178
179
180
181
182
183
184

185

186
187
188
189
190
191
192
193
194
195
196
197
198

199

200
201
202
203
204
205
206
207
208
209
210
211
212

213

214
215



216
217
218
219
220
221




222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239

240
241
242
243
244
245
246
247
248
249
#ifndef CXXOMFORT_IMPL_FUNCTIONMETA_HPP
#define CXXOMFORT_IMPL_FUNCTIONMETA_HPP

#if (CXXOMFORT_CXX_STD >= 1997)

/**
 * @file
 * @brief Meta information for function types.
 * 
 * Interfaces defined in this file:
 * 
................................................................................
    typedef std::tuple<Args...> arguments;  \
    typedef Ret return_type;  \
    enum { arity = sizeof...(Args) };  \
};  \

MAKE_FUNCTIONTYPE(0);
MAKE_FUNCTIONTYPE(0, const);
#if (CXXOMFORT_CXX_STD>=2017)
MAKE_FUNCTIONTYPE(0, noexcept);
MAKE_FUNCTIONTYPE(0, const noexcept);
#endif

#undef MAKE_FUNCTIONTYPE

#else

template <typename Ret>
struct functiontype<Ret()> {
................................................................................
template <typename Fn, Fn const * fn>
struct function_caller {
    typedef cxxomfort::impl::functiontype<Fn> FT;
    typedef typename FT::return_type return_type;
    
    static typename FT::pointer ptr() CXXO_NOEXCEPTNOTHROW { return fn; }

#if (CXXOMFORT_CXX_STD >= 2011)
    template <typename... Args
    , typename = std::enable_if < FT::arity == sizeof...(Args)> 
    >
    CXXO_CONSTEXPR typename FT::return_type operator() (Args&&... args) const {
        return fn(std::forward<Args...>(args...));
    }

................................................................................
	#if (CXXOMFORT_CXX_STD>=2017)
    template <typename... Args>
    CXXO_CONSTEXPR typename FT::return_type operator() (Args&&... args) const noexcept {
        return fn(std::forward<Args...>(args...));
    }
	#endif

#else
	// c++03 implementation moved outside
#endif

};
#else // c++03


template <typename Fn, Fn const * fn>
struct function_caller;

template <typename R, typename A1, R(* const fn)(A1)>
struct function_caller<R(A1), fn> {
    typedef cxxomfort::impl::functiontype<R(A1)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1) const {
        return fn(a1);
    }
    

    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW {
		return fn;
	}

};

template <typename R, typename A1, typename A2, R(* const fn)(A1,A2)>
struct function_caller<R(A1,A2), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1,A2 a2) const {
        return fn(a1,a2);
    }
    

    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }

};

template <typename R, typename A1, typename A2, typename A3, R(* const fn)(A1,A2,A3)>
struct function_caller<R(A1,A2,A3), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3) const {
        return fn(a1,a2,a3);
    }
    

    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }

};


template <typename R, typename A1, typename A2, typename A3, typename A4, R(* const fn)(A1,A2,A3,A4)>
struct function_caller<R(A1,A2,A3,A4), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3,A4)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3, A4 a4) const {
        return fn(a1,a2,a3,a4);
    }
    

    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }

};

template <typename R
, typename A1, typename A2, typename A3, typename A4, typename A5, R(* const fn)(A1,A2,A3,A4,A5)>
struct function_caller<R(A1,A2,A3,A4,A5), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3,A4,A5)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const {
        return fn(a1,a2,a3,a4,a5);
    }
    

    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }

};





#endif


// specialization for zero-argument callables





#define CALLING(MODIFIER) \
    typedef cxxomfort::impl::functiontype<T() MODIFIER> FT;  \
    typedef typename FT::return_type return_type;  \
	T operator() () const MODIFIER { return fn(); }  \


template <typename T, T(* const fn)() >
struct function_caller<T(), fn> {
    CALLING();
};

#if (CXXOMFORT_CXX_STD>=2017)
template <typename T, T(* const fn)() noexcept >
struct function_caller<T() noexcept, fn> {
    CALLING(noexcept);
};
#endif




} }

#else // < 1997
	// unsupported
	
#endif // CXX_STD

#endif



<







 







|


|







 







<







 







<
<
<
<

<
>













|
>



>












>

>











|
>

>













>

>













>

>


>
>
>






>
>
>
>











|




|

>




<
<
|
<
<

1
2
3

4
5
6
7
8
9
10
..
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
...
114
115
116
117
118
119
120

121
122
123
124
125
126
127
...
128
129
130
131
132
133
134




135

136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255


256


257
#ifndef CXXOMFORT_IMPL_FUNCTIONMETA_HPP
#define CXXOMFORT_IMPL_FUNCTIONMETA_HPP



/**
 * @file
 * @brief Meta information for function types.
 * 
 * Interfaces defined in this file:
 * 
................................................................................
    typedef std::tuple<Args...> arguments;  \
    typedef Ret return_type;  \
    enum { arity = sizeof...(Args) };  \
};  \

MAKE_FUNCTIONTYPE(0);
MAKE_FUNCTIONTYPE(0, const);
	#if (CXXOMFORT_CXX_STD>=2017)
MAKE_FUNCTIONTYPE(0, noexcept);
MAKE_FUNCTIONTYPE(0, const noexcept);
	#endif

#undef MAKE_FUNCTIONTYPE

#else

template <typename Ret>
struct functiontype<Ret()> {
................................................................................
template <typename Fn, Fn const * fn>
struct function_caller {
    typedef cxxomfort::impl::functiontype<Fn> FT;
    typedef typename FT::return_type return_type;
    
    static typename FT::pointer ptr() CXXO_NOEXCEPTNOTHROW { return fn; }


    template <typename... Args
    , typename = std::enable_if < FT::arity == sizeof...(Args)> 
    >
    CXXO_CONSTEXPR typename FT::return_type operator() (Args&&... args) const {
        return fn(std::forward<Args...>(args...));
    }

................................................................................
	#if (CXXOMFORT_CXX_STD>=2017)
    template <typename... Args>
    CXXO_CONSTEXPR typename FT::return_type operator() (Args&&... args) const noexcept {
        return fn(std::forward<Args...>(args...));
    }
	#endif





};

#elif (CXXOMFORT_CXX_STD>=1997) // c++03

template <typename Fn, Fn const * fn>
struct function_caller;

template <typename R, typename A1, R(* const fn)(A1)>
struct function_caller<R(A1), fn> {
    typedef cxxomfort::impl::functiontype<R(A1)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1) const {
        return fn(a1);
    }

	#if (CXXOMFORT_CXX_STD>=1997)
    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW {
		return fn;
	}
	#endif
};

template <typename R, typename A1, typename A2, R(* const fn)(A1,A2)>
struct function_caller<R(A1,A2), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1,A2 a2) const {
        return fn(a1,a2);
    }
    
    #if (CXXOMFORT_CXX_STD>=1997)
    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }
    #endif
};

template <typename R, typename A1, typename A2, typename A3, R(* const fn)(A1,A2,A3)>
struct function_caller<R(A1,A2,A3), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3) const {
        return fn(a1,a2,a3);
    }

	#if (CXXOMFORT_CXX_STD>=1997)
    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }
    #endif
};


template <typename R, typename A1, typename A2, typename A3, typename A4, R(* const fn)(A1,A2,A3,A4)>
struct function_caller<R(A1,A2,A3,A4), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3,A4)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3, A4 a4) const {
        return fn(a1,a2,a3,a4);
    }
    
	#if (CXXOMFORT_CXX_STD>=1997)
    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }
    #endif
};

template <typename R
, typename A1, typename A2, typename A3, typename A4, typename A5, R(* const fn)(A1,A2,A3,A4,A5)>
struct function_caller<R(A1,A2,A3,A4,A5), fn> {
    typedef cxxomfort::impl::functiontype<R(A1,A2,A3,A4,A5)> FT;
    typedef typename FT::return_type return_type;

    return_type operator() 
    (A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const {
        return fn(a1,a2,a3,a4,a5);
    }
    
	#if (CXXOMFORT_CXX_STD>=1997)
    static typename FT::pointer ptr () CXXO_NOEXCEPTNOTHROW { return fn; }
    #endif
};


#else // CXX_STD < 1997


#endif


// specialization for zero-argument callables

#if (CXXOMFORT_CXX_STD<1997)


#else
#define CALLING(MODIFIER) \
    typedef cxxomfort::impl::functiontype<T() MODIFIER> FT;  \
    typedef typename FT::return_type return_type;  \
	T operator() () const MODIFIER { return fn(); }  \


template <typename T, T(* const fn)() >
struct function_caller<T(), fn> {
    CALLING();
};

	#if (CXXOMFORT_CXX_STD>=2017)
template <typename T, T(* const fn)() noexcept >
struct function_caller<T() noexcept, fn> {
    CALLING(noexcept);
};
	#endif

#endif // CXX_STD


} }






#endif

Changes to cxxomfort/cxxomfort/impl/relationals.hpp.

3
4
5
6
7
8
9











10
11
12
13
14
15
16
17








18
19
20
21
22
23
24
/**
 * @file
 * @brief Macros for generating relational operators.
 */

// automatic generation of relational operators












#define CXXO_GENERATE_RELATIONALS2(L,R) \
inline bool operator!= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl==vr); } \
inline bool operator>  (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return vr<vl; } \
inline bool operator<= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl>vr); } \
inline bool operator>= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl<vr); } \

/**
 * @brief Automatically generates nonmember relational operators >, >=, <= and != .








 * */
#define CXXO_GENERATE_RELATIONALS(T) \
inline bool operator!= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl==vr); } \
inline bool operator>  (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return vr<vl; } \
inline bool operator<= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl>vr); } \
inline bool operator>= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl<vr); } \








>
>
>
>
>
>
>
>
>
>
>








>
>
>
>
>
>
>
>







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/**
 * @file
 * @brief Macros for generating relational operators.
 */

// automatic generation of relational operators

/**
 * @brief Automatically generates relational operators between the classes @a L and @a R .
 * @ingroup cxxomfort-codegen
 * 
 * If classes @a L and @a R have working operators <tt>==</tt> and <tt><</tt>, invoking this macro 
 * <b>outside</b> their class definition will automatically generate compatible 
 * non-member operators != , <= , >, >= .
 * 
 * All generated operators have the signature <tt>bool(L const&, R const&)</tt> and are @c noexcept or @c throw() .
 * 
 * */
#define CXXO_GENERATE_RELATIONALS2(L,R) \
inline bool operator!= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl==vr); } \
inline bool operator>  (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return vr<vl; } \
inline bool operator<= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl>vr); } \
inline bool operator>= (L const& vl, R const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl<vr); } \

/**
 * @brief Automatically generates nonmember relational operators >, >=, <= and != .
 * @ingroup cxxomfort-codegen
 * 
 * If class @a T has working operators <tt>==</tt> and <tt><</tt>, invoking this macro 
 * <b>outside</b> the class definition will automatically generate compatible 
 * non-member operators != , <= , >, >= .
 * 
 * All generated operators return @c bool and are @c noexcept or @c throw() .
 * 
 * */
#define CXXO_GENERATE_RELATIONALS(T) \
inline bool operator!= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl==vr); } \
inline bool operator>  (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return vr<vl; } \
inline bool operator<= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl>vr); } \
inline bool operator>= (T const& vl, T const& vr) CXXO_NOEXCEPTNOTHROW { return !(vl<vr); } \

Added cxxomfort/cxxomfort/impl/unique_ptr-poor.hpp.































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
#ifndef CXXOMFORT_UNIQUE_PTR_POOR_HPP
#define CXXOMFORT_UNIQUE_PTR_POOR_HPP


#include "../config.hpp"

#define CXXOMFORT_USING_unique_ptr
#define CXXOMFORT_IMPLEMENTS_unique_ptr CXXO_IMPLSTATUS_EMULATION()

#include "../base.hpp" // nullptr, static_assert, move, forward
#include "../util/meta.hpp"
#include "../util/type_traits.hpp"
#include CXXO_INCLUDE_SYS(cstddef) 
#include CXXO_INCLUDE_SYS(memory) 
#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
    #pragma message CXXO_NOTICE("enabled unique_ptr POOR emulation")
#endif

/*
 * Dependencies from type_traits:
 * is_reference
 * add_reference
 * remove_reference
 * is_const
 * enable_if (provided by meta.hpp)
 * is_empty
 */


namespace cxxomfort {
namespace cxxostd {

namespace detail_unique_ptr {

using ::cxxomfort::traits::is_empty;
using ::cxxomfort::traits::is_reference;
using ::cxxomfort::traits::add_reference;
using ::cxxomfort::traits::remove_reference;


//
// rv wrapper class
//
template <class T>
class rv {
    T& r_;
public:
    explicit rv(T& r) : r_(r) {}
    T* operator->() {return &r_;}
    T& operator*() {return r_;}
};


template <class T1, class T2, bool E = false>
class unique_ptr_storage {
    private:
    T1 t1_;
    T2 t2_;

    typedef typename add_reference<T2>::type T2_reference;
    typedef typename add_reference<const T2>::type T2_const_reference;

    unique_ptr_storage(const unique_ptr_storage&);
    unique_ptr_storage& operator=(const unique_ptr_storage&);
public:
    operator rv<unique_ptr_storage>() {return rv<unique_ptr_storage>(*this);}

    unique_ptr_storage() : t1_(), t2_() CXXO_NOEXCEPT {}

    explicit unique_ptr_storage(T1 t1)
        : t1_(move(t1)), t2_() {}

    unique_ptr_storage(T1 t1, T2 t2)
        : t1_(move(t1)), t2_(forward<T2>(t2)) {}

          T1& first()       {return t1_;}
    const T1& first() const {return t1_;}

          T2_reference second()       {return t2_;}
    T2_const_reference second() const {return t2_;}
};


template <class T1, class T2, bool b> inline
void
swap(unique_ptr_storage<T1, T2, b>& x, unique_ptr_storage<T1, T2, b>& y) {
    using std::swap;
    swap(x.first(), y.first());
    swap(x.second(), y.second());
}


namespace pointer_type_imp {

	struct one { char x[1]; };
	struct two { char x[2]; };
	template <class U> static two test(...);
	template <class U> static one test(typename U::pointer* = 0);

}  //~namespace pointer_type_imp

template <class T>
struct has_pointer_type {
    static const bool value = sizeof(pointer_type_imp::test<T>(0)) == 1;
};


namespace pointer_type_imp {

	template <typename T, typename D, bool = has_pointer_type<D>::value>
	struct pointer_type;
	
	template <class T, class D>
	struct pointer_type<T,D,true> {
		typedef typename D::pointer type;
	};

	template <class T, class D>
	struct pointer_type<T, D, false> {
		typedef T* type;
	};


} // impl

template <class T, class D>
struct pointer_type {
    typedef typename pointer_type_imp::pointer_type<T,
    typename remove_reference<D>::type>::type type;
};

} // detail_unique_ptr

template <class T>
struct default_delete {

    default_delete() CXXO_NOEXCEPTNOTHROW {}
    virtual ~default_delete () {};

/*
    template <class U>
    default_delete ( const default_delete<U>&)  {
    }
*/

    void operator() (T* ptr) const  CXXO_NOEXCEPTNOTHROW   {
        static_assert (sizeof(T) > 0, "T must be a complete type");
        delete ptr;
    }
};

template <class T>
struct default_delete<T[]> {
    void operator() (T* ptr) const CXXO_NOEXCEPTNOTHROW {
        static_assert (sizeof(T) > 0, "T must be a complete type");
        delete [] ptr;
    }

private:

    //template <class U> void operator()(U*) const;
};

template <typename T, class D = cxxomfort::cxxostd::default_delete<T> >
class unique_ptr;


template <typename T, typename D>
detail_unique_ptr::rv< unique_ptr<T,D> > move (unique_ptr<T,D>& r) {
	return r;
}

template <typename T, class D>
class unique_ptr {
	
	public:
    typedef T element_type;
    typedef D deleter_type;
    typedef typename detail_unique_ptr::pointer_type<element_type, deleter_type>::type pointer;
	
	private:
	detail_unique_ptr::unique_ptr_storage<T,D,false> ptr_;

	private:
    //CXXO_NONCOPYABLE_MOVABLE(unique_ptr);
    CXXO_DELETED_COPY_CONSTRUCTOR(unique_ptr);
    //CXXO_DELETED_COPY_ASSIGN(unique_ptr);
	
	public:

    typedef typename cxxomfort::traits::add_reference<deleter_type>::type deleter_reference;
    typedef typename cxxomfort::traits::add_reference<const deleter_type>::type deleter_const_reference;

    //! Creates from a rvalue-wrapper (from eg.: @e move ).
    //unique_ptr(detail_unique_ptr::rv<unique_ptr> r)
    
    //unique_ptr( CXXO_RV_REF(unique_ptr) r)
    //: ptr_(r.release(), std::forward<deleter_type>(r.get_deleter())) {
    //}
    

    //! Default constructor.
    unique_ptr() CXXO_NOEXCEPTNOTHROW 
    : ptr_(nullptr) {
        static_assert (!cxxomfort::traits::is_reference<deleter_type>::value, "Trying to use the deleter of a reference type.");
        static_assert (!cxxomfort::traits::is_pointer<deleter_type>::value, "Trying to use the deleter of a pointer type.");
    }

    //! Creates a @c unique_ptr wrapping the allocated pointer @a p .
    explicit unique_ptr(pointer p) 
    : ptr_(p) {
        static_assert (!cxxomfort::traits::is_reference<deleter_type>::value, "Trying to use the deleter of a reference type.");
        static_assert (!cxxomfort::traits::is_pointer<deleter_type>::value, "Trying to use the deleter of a pointer type.");
    }

    // Destructor
    ~unique_ptr() {
        reset();
    }

	unique_ptr& operator= (unique_ptr& r) {
        reset(r.release());
        ptr_.second() = std::move(r.get_deleter());
        return *this;
	}
	
    unique_ptr& operator=(detail_unique_ptr::rv<unique_ptr> r) {
    //unique_ptr& operator=( CXXO_RV_REF(unique_ptr) r) {
        reset(r.release());
        ptr_.second() = std::move(r.get_deleter());
        return *this;
    }



    //! Provide access to member.
    typename cxxomfort::traits::add_reference<T>::type operator*() const {return *get();}
    //! Provides access to member.
    pointer operator->() const {return get();}
    //! Provides access to member.
    pointer get() const {return ptr_.first();}
    //! Provides access to deleter.
    deleter_reference       get_deleter()       {return ptr_.second();}
    deleter_const_reference get_deleter() const {return ptr_.second();}

    //operator int nat::*() const {return get() ? &nat::for_bool_ : 0;}
    CXXO_EXPLICIT_OPERATOR(bool) () const CXXO_NOEXCEPTNOTHROW {
        return this->get() ? true : false;
    }


    //! Resets / reassigns the @c unique_ptr to another allocated pointer.
    void reset (pointer p = pointer()) {
        pointer t = get();
        if (t != pointer())
            get_deleter()(t);
        ptr_.first() = p;
    }

    pointer release() {
        pointer tmp = get();
        ptr_.first() = pointer();
        return tmp;
    }

};


#if 0

//
// implementation details
//
namespace detail_unique_ptr {


typedef char one;
struct two {one _[2];};

// An is_convertible<From, To> that considers From an rvalue (consistent with C++0X).
//   This is a simplified version neglecting the types function, array, void and abstract types
//   I had to make a special case out of is_convertible<T,T> to make move-only
//   types happy.

namespace is_conv_imp {
    template <class T> one test1(const T&);
    template <class T> two test1(...);
    template <class T> one test2(T);
    template <class T> two test2(...);
    template <class T> T source();
}

template <class T1, class T2>
struct is_convertible {
    static const bool value = sizeof(is_conv_imp::test1<T2>(is_conv_imp::source<T1>())) == 1;
};

template <class T>
struct is_convertible<T, T> {
    static const bool value = sizeof(is_conv_imp::test2<T>(is_conv_imp::source<T>())) == 1;
};


}  //~detail_unique_ptr

/*
 * These functions conflict with move/forward
 *

template <class T> inline
typename ::cxxomfort::enable_if
<
    !detail_unique_ptr::is_convertible<T, detail_unique_ptr::rv<T> >::value,
    T&
>::type
move(T& t) { return t; }

template <class T> inline
typename ::cxxomfort::enable_if
<
    !detail_unique_ptr::is_convertible<T, detail_unique_ptr::rv<T> >::value,
    const T&
>::type
move(const T& t) { return t; }

template <class T> inline
typename ::cxxomfort::enable_if
<
    detail_unique_ptr::is_convertible<T, detail_unique_ptr::rv<T> >::value,
    T
>::type
move(T& t) {
    return T(detail_unique_ptr::rv<T>(t));
}

template <class T>
inline
typename cxxomfort::enable_if
<
    is_reference<T>::value,
    T
>::type
forward(typename identity<T>::type t) {
    return t;
}

template <class T> inline
typename cxxomfort::enable_if
<
    !is_reference<T>::value,
    T
>::type
forward(typename identity<T>::type& t) {
    return move(t);
}

template <class T> inline
typename cxxomfort::enable_if
<
    !is_reference<T>::value,
    T
>::type
forward(const typename identity<T>::type& t) {
    return move(const_cast<T&>(t));
}
*/

namespace detail_unique_ptr {

namespace pointer_type_imp {

template <typename T>
struct remove_reference {
    typedef T type;
};

template <typename T>
struct remove_reference<T&> {
    typedef T type;
};



}  //~namespace detail_unique_ptr


//
// unique_ptr
//
/**
 * @brief unique_ptr: a scoped, movable smart pointer.
 * Emulation of the unique_ptr implementation in C++11 for C++03 compilers.
 * Original backport by Howard Hinnant.
 */
template <typename T, typename D = default_delete<T> >
class unique_ptr {
public:
    typedef T element_type;
    typedef D deleter_type;
    typedef typename detail_unique_ptr::pointer_type<element_type, deleter_type>::type pointer;

private:
    CXXO_NONCOPYABLE_MOVABLE(unique_ptr);
private:
    detail_unique_ptr::unique_ptr_storage<pointer, deleter_type> ptr_;

    typedef typename cxxomfort::traits::add_reference<deleter_type>::type deleter_reference;
    typedef typename cxxomfort::traits::add_reference<const deleter_type>::type deleter_const_reference;

    struct nat {int for_bool_;};

    //unique_ptr(unique_ptr&);
    //unique_ptr& operator=(unique_ptr&);

public:
    //! Converts @c unique_ptr to its rvalue-wrapper (for eg.: @e move ).
    operator detail_unique_ptr::rv<unique_ptr>() {
        return detail_unique_ptr::rv<unique_ptr>(*this);
    }

    //unique_ptr& operator=(detail_unique_ptr::rv<unique_ptr> r) {
    unique_ptr& operator=( CXXO_RV_REF(unique_ptr) r) {
        reset(r.release());
        ptr_.second() = std::move(r.get_deleter());
        return *this;
    }


    //! Creates a @c unique_ptr given a pointer and a deleter, which is stored unreferenced.
    unique_ptr(pointer p, typename std::conditional<cxxomfort::traits::is_reference<D>::value
        , volatile typename cxxomfort::traits::remove_reference<D>::type&, D
    >::type d)
    : ptr_(std::move(p), std::forward<D>(const_cast<typename cxxomfort::traits::add_reference<D>::type>(d))) {}

    //! Creates a @c unique_ptr from a convertible pointer and deleter
    template <class U, class E>
    unique_ptr(unique_ptr<U, E> u, typename std::enable_if<
        !cxxomfort::traits::is_array<U>::value
        && detail_unique_ptr::is_convertible<typename unique_ptr<U>::pointer, pointer>::value
        && detail_unique_ptr::is_convertible<E, deleter_type>::value
        && ( !cxxomfort::traits::is_reference<deleter_type>::value || cxxomfort::traits::is_same<deleter_type, E>::value )
        , void
    >::type* = 0)
    : ptr_(u.release(), std::forward<D>(std::forward<E>(u.get_deleter()))) {
    }

    // Destructor
    ~unique_ptr() {
        reset();
    }

    //! reset a @c unique_ptr by assigning null pointer literal
    unique_ptr& operator=(std::nullptr_t) {
        reset();
        return *this;
    }

    //! Assignment (moves resource to this object).
    template <class U, class E>
    unique_ptr& operator=(unique_ptr<U, E> u) {
        reset(u.release());
        ptr_.second() = std::move(u.get_deleter());
        return *this;
    }

    //! Provide access to member.
    typename cxxomfort::traits::add_reference<T>::type operator*() const {return *get();}

    // (safe-bool conversion)
    //operator int nat::*() const {return get() ? &nat::for_bool_ : 0;}
    CXXO_EXPLICIT_OPERATOR(bool) () const CXXO_NOEXCEPTNOTHROW {
        return this->get() ? true : false;
    }

    //! Resets / reassigns the @c unique_ptr to another allocated pointer.
    void reset (pointer p = pointer()) {
        pointer t = get();
        if (t != pointer())
            get_deleter()(t);
        ptr_.first() = p;
    }

    //! Returns the owned pointer and releases its ownership.
    pointer release() {
        pointer tmp = get();
        ptr_.first() = pointer();
        return tmp;
    }

    //! Swap
    void swap(unique_ptr& u) {
        detail_unique_ptr::swap(ptr_, u.ptr_);
    }

};









template <class T, class D>
class unique_ptr<T[], D> {
public:
    typedef T element_type;
    typedef D deleter_type;
    typedef typename detail_unique_ptr::pointer_type<element_type, deleter_type>::type pointer;

private:
    detail_unique_ptr::unique_ptr_storage<pointer, deleter_type> ptr_;

    typedef typename cxxomfort::traits::add_reference<deleter_type>::type deleter_reference;
    typedef typename cxxomfort::traits::add_reference<const deleter_type>::type deleter_const_reference;

    struct nat {int for_bool_;};

    unique_ptr(unique_ptr&);
    unique_ptr& operator=(unique_ptr&);

public:
    operator detail_unique_ptr::rv<unique_ptr>() {
        return detail_unique_ptr::rv<unique_ptr>(*this);
    }
    unique_ptr( CXXO_RV_REF(unique_ptr) r) : ptr_(r->release(), std::forward<deleter_type>(r->get_deleter())) {
    }
    unique_ptr& operator=(detail_unique_ptr::rv<unique_ptr> r) {
        reset(r->release());
        ptr_.second() = std::move(r->get_deleter());
        return *this;
    }

    unique_ptr() {
        static_assert (!cxxomfort::traits::is_reference<deleter_type>::value, "Trying to use the deleter of a reference type.");
        static_assert (!cxxomfort::traits::is_pointer<deleter_type>::value, "Trying to use the deleter of a pointer type.");
    }

    explicit unique_ptr(pointer p) : ptr_(p) {
        static_assert (!cxxomfort::traits::is_reference<deleter_type>::value, "Trying to use the deleter of a reference type.");
        static_assert (!cxxomfort::traits::is_pointer<deleter_type>::value, "Trying to use the deleter of a pointer type.");
    }

    unique_ptr(pointer p, typename std::conditional<cxxomfort::traits::is_reference<D>::value,
                          volatile typename cxxomfort::traits::remove_reference<D>::type&, D>::type d)
        : ptr_(move(p), std::forward<D>(const_cast<typename cxxomfort::traits::add_reference<D>::type>(d))) {}

    ~unique_ptr() {
        reset();
    }

    pointer get() const {
        return ptr_.first();
    }
    element_type& operator[] (size_t i) const {
        return get()[i];
    }
    deleter_reference       get_deleter()       {return ptr_.second();}
    deleter_const_reference get_deleter() const {return ptr_.second();}
    operator int nat::*() const {return get() ? &nat::for_bool_ : 0;}

    void reset(pointer p = pointer()) {
        pointer t = get();
        if (t != pointer())
            get_deleter()(t);
        ptr_.first() = p;
    }



    void swap(unique_ptr& u) {
        detail_unique_ptr::swap(ptr_, u.ptr_);
    }

private:
    template <class U>
    explicit unique_ptr(U,
        typename std::enable_if
        <detail_unique_ptr::is_convertible<U, pointer>::value
        , void
        >::type* = 0);

    template <class U>
    unique_ptr(U, typename std::conditional<cxxomfort::traits::is_reference<D>::value,
                volatile typename cxxomfort::traits::remove_reference<D>::type&, D>::type,
                typename std::enable_if< detail_unique_ptr::is_convertible<U, pointer>::value, void>::type* = 0);
};

template<class T, class D>
inline void swap (unique_ptr<T, D>& x, unique_ptr<T, D>& y) {
    x.swap(y);
}

template<class T1, class D1, class T2, class D2>
inline bool operator==(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return x.get() == y.get();
}

template<class T1, class D1, class T2, class D2>
inline bool operator!=(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return !(x == y);
}

template<class T1, class D1, class T2, class D2>
inline bool operator<(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return x.get() < y.get();
}

template<class T1, class D1, class T2, class D2>
inline bool operator<=(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return !(y < x);
}

template<class T1, class D1, class T2, class D2>
inline bool operator>(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return y < x;
}

template<class T1, class D1, class T2, class D2>
inline bool operator>=(unique_ptr<T1, D1> const& x, const unique_ptr<T2, D2>& y) {
    return !(x < y);
}

// comparison with nullptr
template <typename T, typename D>
inline bool operator== (unique_ptr<T,D> const& up, std::nullptr_t) {
    return up.get()==nullptr;
}
template <typename T, typename D>
inline bool operator== (std::nullptr_t, unique_ptr<T,D> const& up) {
    return up.get()==nullptr;
}
template <typename T, typename D>
inline bool operator!= (unique_ptr<T,D> const& up, std::nullptr_t) {
    return !(up==nullptr);
}
template <typename T, typename D>
inline bool operator!= (std::nullptr_t, unique_ptr<T,D> const& up) {
    return !(up==nullptr);
}


#endif // 0

} //~namespace memory
} //~namespace cxxomfort

namespace std {
    using ::cxxomfort::cxxostd::unique_ptr;
    using ::cxxomfort::cxxostd::move;
}


#endif  // guard

Changes to cxxomfort/cxxomfort/library/algorithm.hpp.

358
359
360
361
362
363
364

365
366
367
368
369
370
371
372
373
374
375
376
377
378
 * 
 * Interfaces defined here:
 * 
 * * @c valcmp() - compares two values in the way strcmp, memcmp do.
 * * @c copy_leftmost_n() , @c copy_rightmost_n () - copies from either end of a sequence.
 * * @c count_while() - counts elements in a sequence.
 * * @c find_not() , @c find_if_not() - complements to @c find() , from p1223.

 * * @c find_inversion() - finds elements out of place in a sequence.
 * * @c find_last_if() - finds elements matching a predicate.
 * * @c transform_inplace() , @c transform_inplace_if() - transforms sequences in-place.
 * * @c transform_n() - transforms sequences.
 * * @c count_frequencies_map() , @c count_frequencies() - gathers data frequency in a sequence.
 * * @c relative_search() - finds element ranges matching a differential.
 * * @c lfv2::erase(), lfv2::erase_if() from Fundamentals V2 - simplified erase-remove idiom for sequence containers.
 * 
 * 
 * All interfaces are defined in the namespace <code>cxxomfort::library::algorithm::</code>.
 * 
 * See also: @ref std0algorithm  .
 * 
 * */







>






|







358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
 * 
 * Interfaces defined here:
 * 
 * * @c valcmp() - compares two values in the way strcmp, memcmp do.
 * * @c copy_leftmost_n() , @c copy_rightmost_n () - copies from either end of a sequence.
 * * @c count_while() - counts elements in a sequence.
 * * @c find_not() , @c find_if_not() - complements to @c find() , from p1223.
 * * binary predicate form @c find() , from lwg127.
 * * @c find_inversion() - finds elements out of place in a sequence.
 * * @c find_last_if() - finds elements matching a predicate.
 * * @c transform_inplace() , @c transform_inplace_if() - transforms sequences in-place.
 * * @c transform_n() - transforms sequences.
 * * @c count_frequencies_map() , @c count_frequencies() - gathers data frequency in a sequence.
 * * @c relative_search() - finds element ranges matching a differential.
 * * @c lfv2::erase() , @c lfv2::erase_if() from Fundamentals V2 - simplified erase-remove idiom for sequence containers.
 * 
 * 
 * All interfaces are defined in the namespace <code>cxxomfort::library::algorithm::</code>.
 * 
 * See also: @ref std0algorithm  .
 * 
 * */

Changes to cxxomfort/cxxomfort/library/functional.hpp.

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
162
163
164
165
166
167
168













169
170
171

172
173
174
175
176
177
178
 * */

#if (CXXOMFORT_CXX_STD>=1997)

// information about function types:
// their arguments, arity, return types, etc.

#include "../impl/functionmeta.hpp"


namespace cxxomfort { namespace library {
namespace functional {

using ::cxxomfort::impl::functiontype;
using ::cxxomfort::impl::function_caller;
................................................................................

//! Generic no-op functor, for wrapping "unset" eg.: @c function , @c function_ref .
struct noop_t {
    CXXO_CONSTEXPR14 void operator() (...) const CXXO_NOEXCEPTNOTHROW {  }

};

#if (CXXOMFORT_CXX_STD>=2014)
constexpr const noop_t noop = {};
#else
const noop_t noop = {};
#endif

//! generic no-op functor with return type T.
template <typename T> 
struct noopT_t {
    CXXO_CONSTEXPR14 T operator() (...) const CXXO_NOEXCEPTNOTHROW { return T(); }
};

................................................................................

namespace cxxomfort { namespace library { namespace functional {
    using ::cxxomfort::impl::function_ref;
} } }

#else // < 1997
	// unsupported













#endif // CXX_STD

#endif


/**
 * @page cxxo-sup-functional
 * @brief Supplements to <functional>.
 * 
 * This section offers a number of alternatives and supplements to features found in 
 * <code><functional></code> such as function objects to complete various tasks, 







|







 







|

|

|







 







>
>
>
>
>
>
>
>
>
>
>
>
>


|
>







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
 * */

#if (CXXOMFORT_CXX_STD>=1997)

// information about function types:
// their arguments, arity, return types, etc.

	#include "../impl/functionmeta.hpp"


namespace cxxomfort { namespace library {
namespace functional {

using ::cxxomfort::impl::functiontype;
using ::cxxomfort::impl::function_caller;
................................................................................

//! Generic no-op functor, for wrapping "unset" eg.: @c function , @c function_ref .
struct noop_t {
    CXXO_CONSTEXPR14 void operator() (...) const CXXO_NOEXCEPTNOTHROW {  }

};

	#if (CXXOMFORT_CXX_STD>=2014)
constexpr const noop_t noop = {};
	#else
const noop_t noop = {};
	#endif

//! generic no-op functor with return type T.
template <typename T> 
struct noopT_t {
    CXXO_CONSTEXPR14 T operator() (...) const CXXO_NOEXCEPTNOTHROW { return T(); }
};

................................................................................

namespace cxxomfort { namespace library { namespace functional {
    using ::cxxomfort::impl::function_ref;
} } }

#else // < 1997
	// unsupported

/*
	#include "../impl/functionmeta.hpp"


namespace cxxomfort { namespace library {
namespace functional {
	using ::cxxomfort::impl::functiontype;
} 
} }

*/

#endif // CXX_STD

#endif // end of file


/**
 * @page cxxo-sup-functional
 * @brief Supplements to <functional>.
 * 
 * This section offers a number of alternatives and supplements to features found in 
 * <code><functional></code> such as function objects to complete various tasks, 

Changes to cxxomfort/cxxomfort/memory.hpp.

12
13
14
15
16
17
18
19
20

21

22



23


24




25



26



27



















28





29

30























31
32
33

34
35
36
37
38
39
40
41
42


43
44
45
46
47

48

49
50


51
52

53
54
55
56
57
58





59
60
61
62
63
64
65
66


67
68
69
70
71
72
73
..
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
...
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
...
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#include "base/alignof.hpp"
#include CXXO_INCLUDE_SYS(memory)

#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <memory> support.")
#endif

#if (CXXOMFORT_CXX_STD>=1997)


namespace cxxomfort {

namespace cxxostd {



}


}












/* alignas, aligned_storage */



















#if ((CXXOMFORT_CXX_STD>=1997 && CXXOMFORT_CXX_STD < 2011) && (CXXO_COMPILER_SUPPORT_alignment_tools==0))







//























// alignas
//


    #ifdef alignas
    #error " cxxomfort -- conflicting #define directive for 'alignas()'!"
    #endif
    #if 0
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
        #define alignas(N) __attribute__ ((aligned(N)))
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC)
        #define alignas(N) __declspec(align(N))
    #endif





//
// aligned_storage

//

#include "impl/11-aligned_storage.hpp"



//
// aligned_union

//

#endif

// pointer_traits, allocator_traits
#include "util/memtraits.hpp"







#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_MEMTOOLS
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
    #pragma message CXXO_NOTICE("memtools support.")
    #endif
#endif // c++11




#if defined(CXXOMFORT_USING_MEMTOOLS)

// We define alignas, alignof depending on compiler specifics
#if 0
#elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_GCC)
................................................................................
    #pragma message CXXO_NOTICE("alignof directives not supported; compilation might fail if using <memory> utilities!")
	#endif
#endif

#else // using c++11 or emulation mode, we might still need to fix some things
// NOTE: in GCC < 4.8, alignas is not supported - not even in in c++11 mode
// (but alignof is)
#if ((CXXOMFORT_CXX_STD >= 2011) && CXXOMFORT_COMPILER_ID==CXXOMFORT_VALUE_GCC && CXXOMFORT_COMPILER_VERSION < 408)
    #define alignas(N) __attribute__ ((aligned(N))
    #define CXXOMFORT_ALIGNMENT_TOOLS_SUPPORTED
#endif // GCC c++11 fix

#endif // check for USING_memtools (1)

#if defined(CXXOMFORT_USING_MEMTOOLS)
//
// Using the above features, we can implement aligned_storage as per cppreference.com
//
................................................................................
        ::new (static_cast<void*>(&*dest)) Value(*ini);
    }
    return dest;
}

} // cxxomfort

//
// addressof
//
#include "impl/11-addressof.hpp"



#else

#endif // c++03/11


//
// unique_ptr
//
#include "impl/unique_ptr.hpp"

#if defined(CXXOMFORT_USING_unique_ptr)

#endif

// assist
namespace cxxomfort {
template <typename T>
bool to_bool (std::unique_ptr<T> const& p) CXXO_NOEXCEPTNOTHROW {
    return p.get() != nullptr;
}

}

#if defined(CXXOMFORT_USING_unique_ptr)
    #include "impl/14-make_unique.hpp"
#else
    #define CXXOMFORT_IMPLEMENTS_make_unique CXXO_IMPLSTATUS_NATIVE()
#endif

#include "impl/17-destroy_at.hpp"


// -- set up needed things in std::
#if (CXXOMFORT_CXX_STD < 2011 && defined(CXXOMFORT_USING_unique_ptr))
    #if (!defined(CXXOMFORT_NO_TR1) && !defined(NO_TR1))
//
// specialize std::tr1::hash for unique_ptr<>
// (this is allowed)
................................................................................
            return static_cast<base_type const*>(this)->operator()(t.get());
        }
    };
CXXO_CLOSE_STDTR1() // } /* tr1 */ }
    #endif
#endif

#endif // CXX_STD

#endif // file

/**
 * @page std0memory <memory>
 * @brief Backports from <memory>
 * 







<

>
|
>
|
>
>
>

>
>
|
>
>
>
>

>
>
>

>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>

>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



>









>
>


<
|
<
>
|
>
|

>
>
|
<
>
|

<

<
<
>
>
>
>
>
|

<
<
<
<
<
<
>
>







 







|
|
|
|







 







<
<
<
<
<
<
<


|


<
<
<
<

<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







 







<







12
13
14
15
16
17
18

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111

112

113
114
115
116
117
118
119
120

121
122
123

124


125
126
127
128
129
130
131






132
133
134
135
136
137
138
139
140
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
...
173
174
175
176
177
178
179







180
181
182
183
184




185





















186
187
188
189
190
191
192
...
208
209
210
211
212
213
214

215
216
217
218
219
220
221
#include "base/alignof.hpp"
#include CXXO_INCLUDE_SYS(memory)

#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <memory> support.")
#endif



#if (CXXOFLAG_namespace_tr1>0)
	#if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC || CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG)
	#include <tr1/memory>
namespace std {
	using tr1::shared_ptr;
	//using tr1::make_shared;
	using tr1::weak_ptr;
}
	#endif
#endif

//
// addressof
//
#include "impl/11-addressof.hpp"

// 
// aligned_storage
//

#if (CXXOMFORT_CXX_STD>=2011)

#elif (CXXOMFORT_CXX_STD>=1997)
	#include "impl/11-aligned_storage.hpp"
#elif (CXXOMFORT_CXX_STD<1997)
	//#include "impl/11-aligned_storage.hpp"

#endif


//
// aligned_union
//



// 
// pointer_traits , allocator_traits
// 

// pointer_traits, allocator_traits
#include "util/memtraits.hpp"

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_MEMTOOLS
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
    #pragma message CXXO_NOTICE("memtools support.")
    #endif
#endif // c++11


//
// unique_ptr
//

#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXOMFORT_CXX_STD>=1997)
	#include "impl/unique_ptr.hpp"
#else
	#include "impl/unique_ptr-poor.hpp"
#endif

// 
// make_unique 
// 

#if (CXXOMFORT_CXX_STD>=2014)
#elif (CXXOMFORT_CXX_STD>=1997)
    #include "impl/14-make_unique.hpp"
#else
#endif


#if 0
//
// alignas
//

/*
    #ifdef alignas
    #error " cxxomfort -- conflicting #define directive for 'alignas()'!"
    #endif
    #if 0
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
        #define alignas(N) __attribute__ ((aligned(N)))
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC)
        #define alignas(N) __declspec(align(N))
    #endif
*/
#endif



// 

// destroy
// 

#include "impl/17-destroy_at.hpp"



// 

// cxxomfort::fix assist
// 





// assist
namespace cxxomfort { namespace fix {
template <typename T>
bool to_bool (std::unique_ptr<T> const& p) CXXO_NOEXCEPTNOTHROW {
    return p.get() != nullptr;
}







} } // cxxomfort::fix



#if defined(CXXOMFORT_USING_MEMTOOLS)

// We define alignas, alignof depending on compiler specifics
#if 0
#elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_GCC)
................................................................................
    #pragma message CXXO_NOTICE("alignof directives not supported; compilation might fail if using <memory> utilities!")
	#endif
#endif

#else // using c++11 or emulation mode, we might still need to fix some things
// NOTE: in GCC < 4.8, alignas is not supported - not even in in c++11 mode
// (but alignof is)
	#if ((CXXOMFORT_CXX_STD >= 2011) && CXXOMFORT_COMPILER_ID==CXXOMFORT_VALUE_GCC && CXXOMFORT_COMPILER_VERSION < 408)
		#define alignas(N) __attribute__ ((aligned(N))
		#define CXXOMFORT_ALIGNMENT_TOOLS_SUPPORTED
	#endif // GCC c++11 fix

#endif // check for USING_memtools (1)

#if defined(CXXOMFORT_USING_MEMTOOLS)
//
// Using the above features, we can implement aligned_storage as per cppreference.com
//
................................................................................
        ::new (static_cast<void*>(&*dest)) Value(*ini);
    }
    return dest;
}

} // cxxomfort








#else

#endif // memtools





























// -- set up needed things in std::
#if (CXXOMFORT_CXX_STD < 2011 && defined(CXXOMFORT_USING_unique_ptr))
    #if (!defined(CXXOMFORT_NO_TR1) && !defined(NO_TR1))
//
// specialize std::tr1::hash for unique_ptr<>
// (this is allowed)
................................................................................
            return static_cast<base_type const*>(this)->operator()(t.get());
        }
    };
CXXO_CLOSE_STDTR1() // } /* tr1 */ }
    #endif
#endif



#endif // file

/**
 * @page std0memory <memory>
 * @brief Backports from <memory>
 * 

Changes to cxxomfort/cxxomfort/random.hpp.

120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
...
145
146
147
148
149
150
151


152
153
154
155
156
157


158
159
160
161
162
163
164
...
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 * @ingroup cxx11-backports
 * @xrefitem std0random "" ""
 * @anchor knuth_b
 */
typedef shuffle_order_engine<std::minstd_rand0, 256> knuth_b;

/**

 * @brief cxxomfort uses @c ranlux24_base as the "default random engine".
 * */
typedef std::ranlux24_base default_random_engine;

} } // cxxomfort::cxxostd::

namespace cxxomfort { namespace fix {
/*
................................................................................
    using cxxostd::shuffle_order_engine;
    using cxxostd::knuth_b;
#endif

#ifdef DOXYGEN_DOC
/**
 * @brief Forwarder for @c std::shuffle_order_engine


 * 
 * */
template <typename Engine, unsigned K> struct shuffle_order_engine {};

/**
 * @brief Forwarder for the @c std::knuth_b specialization of @c shuffle_order_engine .


 * */
typedef shuffle_order_engine<minstd_rand,256> knuth_b;


#endif
} } // cxxomfort::fix

................................................................................
 * Including the header brings up <random>'s features, accounting for eg.: 
 * location being @c std::tr1::random... where set up in C++03.
 * 
 * Interfaces defined in this section:
 * 
 * * @c linear_congruent_engine , @c minstd , @c minstd0 (C++11).
 * * @c shuffle_order_engine , @c knuth_b  (C++11).
 * * @c @link cxxomfort::cxxostd::default_random_engine "default_random_engine" @endlink - in cxxomfort defined as ranlux24_base for C++03.
 * 
 * Non-backport interfaces:
 * 
 * * <code>cxxomfort::fix::shuffle_order_engine</code> - for broken std in MSVC 2010.
 * * @c cxxomfort::fix::knuth_b - for broken std in MSVC 2010.
 *
 * Pending:







>
|







 







>
>






>
>







 







|







120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
...
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
 * @ingroup cxx11-backports
 * @xrefitem std0random "" ""
 * @anchor knuth_b
 */
typedef shuffle_order_engine<std::minstd_rand0, 256> knuth_b;

/**
 * @typedef default_random_engine
 * @brief cxxomfort uses @c ranlux24_base as its "default random engine".
 * */
typedef std::ranlux24_base default_random_engine;

} } // cxxomfort::cxxostd::

namespace cxxomfort { namespace fix {
/*
................................................................................
    using cxxostd::shuffle_order_engine;
    using cxxostd::knuth_b;
#endif

#ifdef DOXYGEN_DOC
/**
 * @brief Forwarder for @c std::shuffle_order_engine
 * @ingroup cxxomfort-fix
 * @xrefitem cxxomfort-fix "<random>" "shuffle_order_engine"
 * 
 * */
template <typename Engine, unsigned K> struct shuffle_order_engine {};

/**
 * @brief Forwarder for the @c std::knuth_b specialization of @c shuffle_order_engine .
 * @ingroup cxxomfort-fix
 * 
 * */
typedef shuffle_order_engine<minstd_rand,256> knuth_b;


#endif
} } // cxxomfort::fix

................................................................................
 * Including the header brings up <random>'s features, accounting for eg.: 
 * location being @c std::tr1::random... where set up in C++03.
 * 
 * Interfaces defined in this section:
 * 
 * * @c linear_congruent_engine , @c minstd , @c minstd0 (C++11).
 * * @c shuffle_order_engine , @c knuth_b  (C++11).
 * * @link cxxomfort::cxxostd::default_random_engine @c default_random_engine @endlink - in cxxomfort defined as ranlux24_base for C++03.
 * 
 * Non-backport interfaces:
 * 
 * * <code>cxxomfort::fix::shuffle_order_engine</code> - for broken std in MSVC 2010.
 * * @c cxxomfort::fix::knuth_b - for broken std in MSVC 2010.
 *
 * Pending:

Changes to cxxomfort/cxxomfort/string.hpp.

1
2
3
4
5
6
7




8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
55
56
57
58
59
60
61



62
63
64
65
66
67
68
69
..
94
95
96
97
98
99
100

101

102
103
104
105
106
107
108
109

110



111

112
113

114
115
116
117

118

119
120
121
122
123
124
125
126
127
128
129
#ifndef CXXOMFORT_STRING_HPP
#define CXXOMFORT_STRING_HPP
/**
 * @file 
 * @brief Implementations and additions tied to <code><string></code>.
 * @xrefitem std0string "" ""
 */





#if (CXXOMFORT_CXX_STD >= 1997)

#include "base.hpp"
#include <iostream>
#include <cstring>
#include <string>
#include "cuchar.hpp"

#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <string> support.")
#endif

namespace cxxomfort {
namespace cxxostd {
}
}



#include "impl/11-to_string.hpp"
#include "impl/11-basic_string_charn.hpp"
//#include "impl/14-string_literal.hpp"



#if (CXXOMFORT_CXX_STD < 2011 && CXXOMFORT_CXX_EMULATION < 2011)

// #include "impl/11-basic_string_hash.hpp"

#include <functional>

    // GCC already has a specialization for string, wstring
    #if (CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_GCC \
    && CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_CLANG \
    && CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_MSC  )
namespace std {

    template<typename Char> 
    struct hash< ::std::basic_string<Char> > {
        typedef ::std::basic_string<Char> argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
................................................................................
                if (wi<<2 > MS ) { wi= 1; }
            }
            return r;
        }    
    };
    
}



    #else
    // GCC (c++03) does not have u16string, u32string 
namespace std { namespace tr1 {

    template<> 
    struct hash< std::u16string > {
        typedef std::u16string argument_type;
        typedef size_t result_type;
................................................................................
            return r;
        }    
    };
    

} } // std::tr1


    #endif // gcc

#endif


#else // CXX_STD

	#include "impl/11-to_string.hpp"

	#if (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_OW,<1300))

		// lacks an operator<< for basic_string





std::ostream& operator<< (
std::ostream& os, std::string const& s) CXXO_NOEXCEPTNOTHROW {

	for (size_t i= 0; i < s.length(); ++i) { os<< s[i]; }
	return os;
}


	#endif

#endif // CXX_STD


#endif

/**
 * @page std0string <string>
 * @brief Backports from <string>
 * 
 * 
 * Interfaces defined in this section:







>
>
>
>



<
|
<
<
|

|
|
|






<
<
|
|
|

>
>
|



|


|
|
|







 







>
>
>
|







 







>
|
>
|




|

<
>
|
>
>
>

>
|
|
>
|



>

>


<
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14

15


16
17
18
19
20
21
22
23
24
25
26


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
..
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133

134
135
136
137
138
139
140
141
#ifndef CXXOMFORT_STRING_HPP
#define CXXOMFORT_STRING_HPP
/**
 * @file 
 * @brief Implementations and additions tied to <code><string></code>.
 * @xrefitem std0string "" ""
 */

#include "base.hpp"
#include <string>
#include <cstring>

#if (CXXOMFORT_CXX_STD >= 1997)


	#include <iostream>


	#include "cuchar.hpp"

	#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
	#pragma message CXXO_NOTICE("enabled <string> support.")
	#endif

namespace cxxomfort {
namespace cxxostd {
}
}



	#include "impl/11-to_string.hpp"
	#include "impl/11-basic_string_charn.hpp"
	//#include "impl/14-string_literal.hpp"



	#if (CXXOMFORT_CXX_STD < 2011 && CXXOMFORT_CXX_EMULATION < 2011)

// #include "impl/11-basic_string_hash.hpp"

		#include <functional>

    // GCC already has a specialization for string, wstring
		#if (CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_GCC \
		&& CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_CLANG \
		&& CXXOMFORT_COMPILER_ID != CXXO_COMPILERID_MSC  )
namespace std {

    template<typename Char> 
    struct hash< ::std::basic_string<Char> > {
        typedef ::std::basic_string<Char> argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
................................................................................
                if (wi<<2 > MS ) { wi= 1; }
            }
            return r;
        }    
    };
    
}
	// compilers that don't have hash<> 
		#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,<1500))
		#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_OW,<9999))
		#else
    // GCC (c++03) does not have u16string, u32string 
namespace std { namespace tr1 {

    template<> 
    struct hash< std::u16string > {
        typedef std::u16string argument_type;
        typedef size_t result_type;
................................................................................
            return r;
        }    
    };
    

} } // std::tr1

		
		#endif // gcc

	#endif // pre-2011


#else // CXX_STD

	#include "impl/11-to_string.pre97.hpp"


// 
// missing operator<< under Watcom
//
	#if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_OW)
//namespace std {


std::ostream& 
operator<< (std::ostream& os, std::string const& str) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	for (size_t i= 0; i < str.length(); ++i) { os<< str[i]; }
	return os;
}

//}
	#endif

#endif // CXX_STD


#endif // file

/**
 * @page std0string <string>
 * @brief Backports from <string>
 * 
 * 
 * Interfaces defined in this section:

Changes to cxxomfort/cxxomfort/system_error.hpp.

504
505
506
507
508
509
510

511
512
513
514
515
516
517
...
521
522
523
524
525
526
527

528
529
530
531
532
533
534
...
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
//

namespace cxxomfort { namespace fix {

/**
 * @class errc
 * @brief Aliases a broken @c std::errc implementation (as a namespace rather than as a type) in MSVC 2010.

 * 
 * */
#ifdef DOXYGEN_DOC
enum class errc {};
#endif

#if (CXXOMFORT_CXX_STD>=2011)
................................................................................
#else
using std::errc;
#endif


/**
 * @brief Creates a value of type @c errc given a numeric error code.

 * 
 * */
static inline errc to_errc(int E) {
#if (CXXO_COMPILER_SUPPORT_cstd_system_error==0)
    return static_cast<cxxomfort::cxxostd::myerrc::type>(E);
#else
    return static_cast<errc>(E);
................................................................................

#else // CXXOMFORT_CXX_STD

#endif // CXXOMFORT_CXX_STD
#endif

/**
 * @page std0system_error
 * 
 * @brief Backports and interfaces for C++11's <system_error> .
 * 
 * Interfaces defined in this file:
 * 
 * * @c #cxxomfort::cxxostd::errc
 * * @c error_category , @c generic_category() , @c system_category()







>







 







>







 







|







504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
...
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
...
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
//

namespace cxxomfort { namespace fix {

/**
 * @class errc
 * @brief Aliases a broken @c std::errc implementation (as a namespace rather than as a type) in MSVC 2010.
 * @ingroup cxxomfort-fix
 * 
 * */
#ifdef DOXYGEN_DOC
enum class errc {};
#endif

#if (CXXOMFORT_CXX_STD>=2011)
................................................................................
#else
using std::errc;
#endif


/**
 * @brief Creates a value of type @c errc given a numeric error code.
 * @ingroup cxxomfort-fix
 * 
 * */
static inline errc to_errc(int E) {
#if (CXXO_COMPILER_SUPPORT_cstd_system_error==0)
    return static_cast<cxxomfort::cxxostd::myerrc::type>(E);
#else
    return static_cast<errc>(E);
................................................................................

#else // CXXOMFORT_CXX_STD

#endif // CXXOMFORT_CXX_STD
#endif

/**
 * @page std0system_error <system_error>
 * 
 * @brief Backports and interfaces for C++11's <system_error> .
 * 
 * Interfaces defined in this file:
 * 
 * * @c #cxxomfort::cxxostd::errc
 * * @c error_category , @c generic_category() , @c system_category()

Changes to cxxomfort/cxxomfort/typeindex.hpp.

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24






25











26
27
28
29
30
31
32

33
34
35
36
37
38
39
40
41
42
43
44
45
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
 * @file
 * @brief Implementations and backports tied to Standard Header <code><typeindex></code>.
 * 
 * Interfaces defined in this file:
 * 
 * * @c type_index (C++11)
 * * @c hash<type_index> (C++11)
 *
 * @see https://en.cppreference.com/w/cpp/header/typeindex
 * 
 */

#if (CXXOMFORT_CXX_STD>=1997)

#include "config.hpp"
#include "base.hpp"   // move, forward

#include <cxxomfort/impl/11-typeindex.hpp>

#if (CXXOMFORT_CXX_STD >= 2011 || CXXO_COMPILER_SUPPORT_cstd_typeindex>0)
    #include <typeindex>






#else











    #if (defined( CXXOFLAG_NO_STD_USING ) && CXXOFLAG_NO_STD_USING>0)
    #else

namespace std {
    using ::cxxomfort::cxxostd::type_index;
}
	#endif // no_std_using

#endif

#include <functional> // hash

#if (defined( CXXOFLAG_NO_STD_USING ) && CXXOFLAG_NO_STD_USING>0)
#else
#if (CXXOMFORT_CXX_STD < 2011 && CXXO_COMPILER_SUPPORT_cstd_typeindex==0)
namespace std {
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    namespace tr1 {
    #endif
    
    template<>
................................................................................
    };
    
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    } // tr1
    #endif

}
#endif
#endif // no_std_using

#else // CXX_STD
#endif

#endif

/**
 * @page std0typeindex <typeindex>
 * @brief Backports related to <typeindex>
 * 
 * Interfaces defined in this section:







|





<
<



<
<


>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>







>


<

<
<







 







<


<
<
<







3
4
5
6
7
8
9
10
11
12
13
14
15


16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

49


50
51
52
53
54
55
56
..
64
65
66
67
68
69
70

71
72



73
74
75
76
77
78
79
/**
 * @file
 * @brief Implementations and backports tied to Standard Header <code><typeindex></code>.
 * 
 * Interfaces defined in this file:
 * 
 * * @c type_index (C++11)
 * * @c hash<type_index> (C++11) (for C++03 only)
 *
 * @see https://en.cppreference.com/w/cpp/header/typeindex
 * 
 */



#include "config.hpp"
#include "base.hpp"   // move, forward



#if (CXXOMFORT_CXX_STD >= 2011 || CXXO_COMPILER_SUPPORT_cstd_typeindex>0)
    #include <typeindex>

#elif (CXXOMFORT_CXX_STD>=1997)

	#include <cxxomfort/impl/11-typeindex.hpp>

    #if (defined( CXXOFLAG_NO_STD_USING ) && CXXOFLAG_NO_STD_USING>0)
    #else

namespace std {
    using ::cxxomfort::cxxostd::type_index;
}
	#endif // no_std_using

#include <functional> // hash

#else // CXX_STD < 1997
	#include <cxxomfort/impl/11-typeindex.hpp>

    #if (defined( CXXOFLAG_NO_STD_USING ) && CXXOFLAG_NO_STD_USING>0)
    #else

namespace std {
    using ::cxxomfort::cxxostd::type_index;
}
	#endif // no_std_using

#endif





#if (CXXOMFORT_CXX_STD < 2011 && CXXO_COMPILER_SUPPORT_cstd_typeindex==0)
namespace std {
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    namespace tr1 {
    #endif
    
    template<>
................................................................................
    };
    
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    } // tr1
    #endif

}

#endif // no_std_using




#endif

/**
 * @page std0typeindex <typeindex>
 * @brief Backports related to <typeindex>
 * 
 * Interfaces defined in this section: