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

Overview
Comment:Commit 2020-07-24 - Fixes for C++20, Clang and MSVC.

Promotes ssize(), de-promotes make_array(), adds and fixes features to use under more recent Clang and MSVC versions.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | clang_min_400 | gcc_min_408 | msvc_min_1600 | release | stable | y2020
Files: files | file ages | folders
SHA3-256: 22a548631aa05ba74bbef192ed3f42cd6f0eb3e7448579270a982e85b808d933
User & Date: luismachuca 2020-07-26 07:03:08
Context
2020-07-27
05:40
Commit 2020-07-25 - Bugfixes and helpers for C++98.

Bugfixes and improvements on MSVC 2005, OpenWatcom compatibility. Leaf check-in: 9229196f user: luismachuca tags: release, y2020, bugfix

2020-07-26
07:03
Commit 2020-07-24 - Fixes for C++20, Clang and MSVC.

Promotes ssize(), de-promotes make_array(), adds and fixes features to use under more recent Clang and MSVC versions. check-in: 22a54863 user: luismachuca tags: clang_min_400, gcc_min_408, msvc_min_1600, release, stable, y2020

2020-07-21
05:41
Commit 2020-07-20 - One (1) is the lowest biggest thing.

Fixes a few issues in algorithm and adds to the base feature set. check-in: e6c8807a user: luismachuca tags: clang_min_400, y2020, gcc_min_505, pre-release

Changes

Changes to cxxomfort/CHANGELOG.txt.



















1
2
3
4
5
6
7


















Commit 2020-07-20 - One (1) is the lowest biggest thing.

Fixes a few issues in algorithm and adds to the base feature set.

  *  cxxomfort: Moved tinyint out of cstdint and made into a utility.
  *  cxxomfort: Added utility <tt>rvoid</tt>.
  *  cxxomfort: Added utility <tt>bool_once</tt>.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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

Commit 2020-07-24 - Fixes for C++20, Clang and MSVC.

Promotes <tt>ssize()</tt>, de-promotes <tt>make_array()</tt>, adds and fixes features to use under more recent Clang and MSVC versions.

  *  algorithm: Correctly announce <tt>minmax</tt> support for Clang.
  *  array: Moved make_array out to Fundamentals (cxxomfort::library).
  *  cstddef: Added <tt>to_value()</tt> synonym for <tt>std::byte</tt> conversion.
  *  functional: Added <tt>unwrap_reference</tt> from C++20.
  *  iterator: Promoted <tt>ssize()</tt> to cxx20-backports.
  *  iterator: Fixed return type of <tt>ssize()</tt> when in C++ >= 11.
  *  numeric: Added sub-namespace <tt>cxxomfort::cxxostd::cxx20</tt>.
  *  numeric: Added move- versions of <tt>accumulate</tt> and <tt>partial_sum</tt> as per p0616.
  *  numeric: Added <tt>move_</tt> synonyms for move-capable versions of numeric algorithms.
  *  system_error: Added support for MSVC >= 2013.
  *  type_traits: Added <tt>to_value()</tt> synonym for integral constant conversion.


Commit 2020-07-20 - One (1) is the lowest biggest thing.

Fixes a few issues in algorithm and adds to the base feature set.

  *  cxxomfort: Moved tinyint out of cstdint and made into a utility.
  *  cxxomfort: Added utility <tt>rvoid</tt>.
  *  cxxomfort: Added utility <tt>bool_once</tt>.

Changes to cxxomfort/cxxomfort/algorithm.hpp.

322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
	//using ::cxxomfort::cxxostd::all_of;
	//using ::cxxomfort::cxxostd::any_of;
	//using ::cxxomfort::cxxostd::none_of;
	//using ::cxxomfort::cxxostd::minmax;
	//using ::cxxomfort::cxxostd::minmax_element;
	#endif

	#if (CXXOMFORT_CXX_STD < 2014 || defined(CXXOMFORT_IMPLEMENTS_two_ranges_equal_mismatch))
	using ::cxxomfort::cxxostd::equal;
	using ::cxxomfort::cxxostd::mismatch;
	#endif
	
	#if (CXXOMFORT_CXX_STD < 2017 && CXXOMFORT_CXX_EMULATION < 2017)
	using ::cxxomfort::cxxostd::for_each_n;
	//using ::cxxomfort::cxxostd::clamp;







|







322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
	//using ::cxxomfort::cxxostd::all_of;
	//using ::cxxomfort::cxxostd::any_of;
	//using ::cxxomfort::cxxostd::none_of;
	//using ::cxxomfort::cxxostd::minmax;
	//using ::cxxomfort::cxxostd::minmax_element;
	#endif

	#if (CXXOMFORT_CXX_STD < 2014 || defined(CXXOMFORT_IMPLEMENTS_equal_mismatch_full_ranges))
	using ::cxxomfort::cxxostd::equal;
	using ::cxxomfort::cxxostd::mismatch;
	#endif
	
	#if (CXXOMFORT_CXX_STD < 2017 && CXXOMFORT_CXX_EMULATION < 2017)
	using ::cxxomfort::cxxostd::for_each_n;
	//using ::cxxomfort::cxxostd::clamp;

Changes to cxxomfort/cxxomfort/array.hpp.

53
54
55
56
57
58
59


60
61
62
63
64
65
66
		#endif

	#endif // tr1

#else // C++>=2011
	#include <array>
#endif // CXX_STD



#endif

#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {
}}
namespace std {







>
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
		#endif

	#endif // tr1

#else // C++>=2011
	#include <array>
#endif // CXX_STD

//#include "impl/n4031_make_array.hpp"

#endif

#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {
}}
namespace std {

Changes to cxxomfort/cxxomfort/backports.hpp.

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
#include "base.hpp"
#include "cxxo-utils.hpp"

#include "cerrno.hpp" // #define s for errno values
#include "cstddef.hpp" // <cstddef> and system backports: byte, nullptr, etc...
#include "cstdint.hpp" // <cstdint> backports: integer types
#include "ctime.hpp" // <ctime> backports: timespec_get
#include "cuchar.hpp" // <cuchar> backports: char16_t, char32_t

#include "algorithm.hpp" // <algorithm> backports: copy_if, minmax, etc...

#include "iterator.hpp" // <iterator> backports: global begin/end, etc





#include "string.hpp" // <string> backports: to_string
#include "utility.hpp" // <utility> backports: declval, exchange, pair, etc...

#include "array.hpp" // std::array
#include "forward_list.hpp" // std::forward_list
#include "string_view.hpp" // <string_view> backports

#include "functional.hpp" // <functional> backports (transparent functors, etc...)
#include "memory.hpp" // <memory> backports (pointer_traits, alignof, unique_ptr, etc...)
#include "numeric.hpp" // <numeric> backports (iota, etc...)


#include "random.hpp" // <random> backports (rename fixes, std::random_device, etc...)
#include "tuple.hpp" // <tuple> backports (tuple get<type>, etc...)

#include "typeindex.hpp" // std::type_index
#include "ostream.hpp" // ostream<< helpers
#include "system_error.hpp" // <system_error> backports
#include "type_traits.hpp" // <type_traits> backports (common_type, decay, is_literal, is_null_pointer, etc...)

#include "ios.hpp" // <ios> stuff.
//#include "span.php" // <span> stuff.

#endif







<


>

>
>
>
>
>



<

<
<
<

<
>
>





<


<



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
#include "base.hpp"
#include "cxxo-utils.hpp"

#include "cerrno.hpp" // #define s for errno values
#include "cstddef.hpp" // <cstddef> and system backports: byte, nullptr, etc...
#include "cstdint.hpp" // <cstdint> backports: integer types
#include "ctime.hpp" // <ctime> backports: timespec_get


#include "algorithm.hpp" // <algorithm> backports: copy_if, minmax, etc...
#include "functional.hpp" // <functional> backports (transparent functors, etc...)
#include "iterator.hpp" // <iterator> backports: global begin/end, etc
#include "numeric.hpp" // <numeric> backports (iota, etc...)

#include "array.hpp" // std::array
#include "cuchar.hpp" // <cuchar> backports: char16_t, char32_t
#include "ios.hpp" // <ios> stuff.
#include "string.hpp" // <string> backports: to_string
#include "utility.hpp" // <utility> backports: declval, exchange, pair, etc...


#include "forward_list.hpp" // std::forward_list



#include "memory.hpp" // <memory> backports (pointer_traits, alignof, unique_ptr, etc...)

#include "string_view.hpp" // <string_view> backports
#include "system_error.hpp" // <system_error> backports
#include "random.hpp" // <random> backports (rename fixes, std::random_device, etc...)
#include "tuple.hpp" // <tuple> backports (tuple get<type>, etc...)

#include "typeindex.hpp" // std::type_index
#include "ostream.hpp" // ostream<< helpers

#include "type_traits.hpp" // <type_traits> backports (common_type, decay, is_literal, is_null_pointer, etc...)


//#include "span.php" // <span> stuff.

#endif

Changes to cxxomfort/cxxomfort/base/cstdint.hpp.

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

#if (CXXOMFORT_CXX_STD>=2011 || CXXO_CXXSTDHEADER_cstdint)
    #if defined(CXXOMFORT_NOTICES)  && (CXXOMFORT_NOTICES > 1)
        #pragma message CXXO_NOTICE("Including <cstdint> in C++11 mode or native")
    #endif
    #include <cstdint>
    #define CXXOMFORT_USING_NATIVE_stdint


#else
    #if 0
        #error ("Unreachable.");
    
    #elif (CXXO_CXXSTDHEADER_cstdint > 0)
        #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
            #pragma message CXXO_NOTICE("Including native <cstdint>")
        #endif
        #include <cstdint>
        #define CXXOMFORT_USING_NATIVE_stdint


    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_CLANG && !defined(_LIBCPP))
    // GCC and clang have a <stdlib.h>
        #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
            #pragma message CXXO_NOTICE("cstdint forwarded to tr1/ <cstdint> [clang]")
        #endif
        #define __STDC_LIMIT_MACROS
        #include <tr1/cstdint>
        #define CXXOMFORT_USING_NATIVE_stdint



    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_GCC)
        #if (CXXOMFORT_COMPILER_VERSION >= 406)
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwarded to tr1/ <cstdint> [gcc]")
            #endif
            #define __STDC_LIMIT_MACROS
            #include <tr1/cstdint>
            #define CXXOMFORT_USING_NATIVE_stdint


        #else
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwardrd to <stdint.h> [gcc]")
            #endif
            #define __STDC_LIMIT_MACROS
            #include <stdint.h>
            #define CXXOMFORT_USING_NATIVE_stdint


        #endif
    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_MSC)
        #if (CXXOMFORT_COMPILER_VERSION>1500)
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwarded to MSVC:<cstdint>")
            #define __STDC_LIMIT_MACROS
            #include <cstdint>
            #define CXXOMFORT_USING_NATIVE_stdint


            #endif
        #else
            //#include <stdint.h>
        #endif
    #else // other compilers
		#include <stdint.h>
		#include <inttypes.h>


    #endif
#endif // c++11

#if (!defined(CXXOMFORT_USING_NATIVE_stdint))
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
        #pragma message CXXO_NOTICE("cstdint forwarded to portable-stdint")
    #endif
    //#define __STDC_LIMIT_MACROS
    #include "../vendor/pstdint.h"
    #define CXXOMFORT_USING_PSTDINT_stdint


    // use up the macro guard of stdint.h to prevent a collission
    #define _MSC_STDINT_H_ // win32
#endif // using pstdint

#include <climits>
#include <stddef.h>
#endif // header








>
>










>
>








>
>









>
>







>
>


|





>
>







>
>










>
>








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

#if (CXXOMFORT_CXX_STD>=2011 || CXXO_CXXSTDHEADER_cstdint)
    #if defined(CXXOMFORT_NOTICES)  && (CXXOMFORT_NOTICES > 1)
        #pragma message CXXO_NOTICE("Including <cstdint> in C++11 mode or native")
    #endif
    #include <cstdint>
    #define CXXOMFORT_USING_NATIVE_stdint
    #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
    #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
#else
    #if 0
        #error ("Unreachable.");
    
    #elif (CXXO_CXXSTDHEADER_cstdint > 0)
        #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
            #pragma message CXXO_NOTICE("Including native <cstdint>")
        #endif
        #include <cstdint>
        #define CXXOMFORT_USING_NATIVE_stdint
        #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
        #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_CLANG && !defined(_LIBCPP))
    // GCC and clang have a <stdlib.h>
        #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
            #pragma message CXXO_NOTICE("cstdint forwarded to tr1/ <cstdint> [clang]")
        #endif
        #define __STDC_LIMIT_MACROS
        #include <tr1/cstdint>
        #define CXXOMFORT_USING_NATIVE_stdint
        #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
        #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()

    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_GCC)
        #if (CXXOMFORT_COMPILER_VERSION >= 406)
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwarded to tr1/ <cstdint> [gcc]")
            #endif
            #define __STDC_LIMIT_MACROS
            #include <tr1/cstdint>
            #define CXXOMFORT_USING_NATIVE_stdint
            #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
            #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
        #else
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwardrd to <stdint.h> [gcc]")
            #endif
            #define __STDC_LIMIT_MACROS
            #include <stdint.h>
            #define CXXOMFORT_USING_NATIVE_stdint
            #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
            #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
        #endif
    #elif (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_MSC)
        #if (CXXOMFORT_COMPILER_VERSION>=1600)
            #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
                #pragma message CXXO_NOTICE("cstdint forwarded to MSVC:<cstdint>")
            #define __STDC_LIMIT_MACROS
            #include <cstdint>
            #define CXXOMFORT_USING_NATIVE_stdint
            #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
            #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
            #endif
        #else
            //#include <stdint.h>
        #endif
    #else // other compilers
		#include <stdint.h>
		#include <inttypes.h>
		#undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
		#define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_BACKPORT()
    #endif
#endif // c++11

#if (!defined(CXXOMFORT_USING_NATIVE_stdint))
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
        #pragma message CXXO_NOTICE("cstdint forwarded to portable-stdint")
    #endif
    //#define __STDC_LIMIT_MACROS
    #include "../vendor/pstdint.h"
    #define CXXOMFORT_USING_PSTDINT_stdint
    #undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
    #define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_EMULATION()
    // use up the macro guard of stdint.h to prevent a collission
    #define _MSC_STDINT_H_ // win32
#endif // using pstdint

#include <climits>
#include <stddef.h>
#endif // header

Changes to cxxomfort/cxxomfort/base/explicit_cast.hpp.

12
13
14
15
16
17
18


19
20
21
22
23
24
25
26
27
28
29
30
 */

#include "../config.hpp"
#include "../base/move.hpp"
//#include <ostream> // debug
#define CXXOMFORT_IMPLEMENTS_n2333 CXXO_IMPLSTATUS_EMULATION()
#define CXXOMFORT_IMPLEMENTS_n2437 CXXO_IMPLSTATUS_EMULATION()


#define CXXOMFORT_IMPLEMENTS_explicit_operator CXXOMFORT_IMPLEMENTS_n2333


#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled 'explicit operator' emulation")
#endif

namespace cxxomfort {
namespace detail {

	template <typename T> 
	struct addref_t {







>
>




|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 */

#include "../config.hpp"
#include "../base/move.hpp"
//#include <ostream> // debug
#define CXXOMFORT_IMPLEMENTS_n2333 CXXO_IMPLSTATUS_EMULATION()
#define CXXOMFORT_IMPLEMENTS_n2437 CXXO_IMPLSTATUS_EMULATION()

#undef  CXXOMFORT_IMPLEMENTS_explicit_operator
#define CXXOMFORT_IMPLEMENTS_explicit_operator CXXOMFORT_IMPLEMENTS_n2333


#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled base 'explicit operator' emulation")
#endif

namespace cxxomfort {
namespace detail {

	template <typename T> 
	struct addref_t {

Changes to cxxomfort/cxxomfort/base/iterator.hpp.

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
 * @}
 */
} // ~::cxxomfort::iterator
} // ~::cxxomfort

#if defined CXXOMFORT_USING_ITERATOR
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled iterator functions support.")
    #endif

#include CXXO_INCLUDE_SYS(iterator)

/*
 * Provide begin, end support for std::valarray as well.
 */







|







243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
 * @}
 */
} // ~::cxxomfort::iterator
} // ~::cxxomfort

#if defined CXXOMFORT_USING_ITERATOR
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled base iterator support.")
    #endif

#include CXXO_INCLUDE_SYS(iterator)

/*
 * Provide begin, end support for std::valarray as well.
 */

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef CXXOMFORT_UTIL_MOVE_00_HPP
#define CXXOMFORT_UTIL_MOVE_00_HPP

// Move emulation, deboostified from Boost
// (Dunno what's the point, Boost.Move is pretty self-standing)

#include "../config.hpp"
//#include "../util/meta.hpp"
#if (CXXOMFORT_CXX_STD >= 2011)
    #error "Library error - this file should only be invoked with c++03"
#endif

namespace cxxomfort{

namespace move_detail {







<







1
2
3
4
5
6
7

8
9
10
11
12
13
14
#ifndef CXXOMFORT_UTIL_MOVE_00_HPP
#define CXXOMFORT_UTIL_MOVE_00_HPP

// Move emulation, deboostified from Boost
// (Dunno what's the point, Boost.Move is pretty self-standing)

#include "../config.hpp"

#if (CXXOMFORT_CXX_STD >= 2011)
    #error "Library error - this file should only be invoked with c++03"
#endif

namespace cxxomfort{

namespace move_detail {

Changes to cxxomfort/cxxomfort/base/nullptr.hpp.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
124
125
126
127
128
129
130

131
132
133
    #define CXXOMFORT_IMPLEMENTS_n1488 CXXO_IMPLSTATUS_NATIVE()

#elif (CXXOMFORT_CXX_STD >= 1997 && CXXO_COMPILER_SUPPORT_nullptr==0)
    #define CXXOMFORT_USING_nullptr
    #define CXXOMFORT_IMPLEMENTS_n1488 CXXO_IMPLSTATUS_BACKPORT()

    #if defined (CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
		#pragma message CXXO_NOTICE("enabled 'nullptr' backport.")
    #endif

/*
 * This is marked as a system header mostly because of 
 * bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48914
 * where it is not possible to omit "nullptr is reserved" warnings.
 */
................................................................................

#else

#endif // using emulation

#define CXXOMFORT_IMPLEMENTS_n1601 CXXOMFORT_IMPLEMENTS_n1488
#define CXXOMFORT_IMPLEMENTS_n2214 CXXOMFORT_IMPLEMENTS_n1601

#define CXXOMFORT_IMPLEMENTS_nullptr CXXOMFORT_IMPLEMENTS_n2214

#endif // file







|







 







>



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
...
124
125
126
127
128
129
130
131
132
133
134
    #define CXXOMFORT_IMPLEMENTS_n1488 CXXO_IMPLSTATUS_NATIVE()

#elif (CXXOMFORT_CXX_STD >= 1997 && CXXO_COMPILER_SUPPORT_nullptr==0)
    #define CXXOMFORT_USING_nullptr
    #define CXXOMFORT_IMPLEMENTS_n1488 CXXO_IMPLSTATUS_BACKPORT()

    #if defined (CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
		#pragma message CXXO_NOTICE("enabled base 'nullptr' backport.")
    #endif

/*
 * This is marked as a system header mostly because of 
 * bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48914
 * where it is not possible to omit "nullptr is reserved" warnings.
 */
................................................................................

#else

#endif // using emulation

#define CXXOMFORT_IMPLEMENTS_n1601 CXXOMFORT_IMPLEMENTS_n1488
#define CXXOMFORT_IMPLEMENTS_n2214 CXXOMFORT_IMPLEMENTS_n1601
#undef  CXXOMFORT_IMPLEMENTS_nullptr
#define CXXOMFORT_IMPLEMENTS_nullptr CXXOMFORT_IMPLEMENTS_n2214

#endif // file

Changes to cxxomfort/cxxomfort/base/static_assert.hpp.

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
85
86
87
88
89
90
91


92
93
94
95
#endif

// implementation
/////////////////

#if defined(CXXOMFORT_USING_static_assert)
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled 'static_assert' emulation.")
    #endif

/*
 * This is marked as a system header 
 * as it uses the name of a C++11 reserved word as an identifier.
 */
#if (CXXO_COMPILERREQ(CXXO_COMPILERID_GCC, >= 406))
................................................................................
#endif

#if defined(CXXOMFORT_USING_static_assert)
#else
#endif
#define CXXOMFORT_IMPLEMENTS_n1604 CXXOMFORT_IMPLEMENTS_n1381
#define CXXOMFORT_IMPLEMENTS_n1720 CXXOMFORT_IMPLEMENTS_n1604


#define CXXOMFORT_IMPLEMENTS_static_assert CXXOMFORT_IMPLEMENTS_n1720


#endif







|







 







>
>




17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
..
85
86
87
88
89
90
91
92
93
94
95
96
97
#endif

// implementation
/////////////////

#if defined(CXXOMFORT_USING_static_assert)
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 2)
    #pragma message CXXO_NOTICE("enabled base 'static_assert' emulation.")
    #endif

/*
 * This is marked as a system header 
 * as it uses the name of a C++11 reserved word as an identifier.
 */
#if (CXXO_COMPILERREQ(CXXO_COMPILERID_GCC, >= 406))
................................................................................
#endif

#if defined(CXXOMFORT_USING_static_assert)
#else
#endif
#define CXXOMFORT_IMPLEMENTS_n1604 CXXOMFORT_IMPLEMENTS_n1381
#define CXXOMFORT_IMPLEMENTS_n1720 CXXOMFORT_IMPLEMENTS_n1604

#undef  CXXOMFORT_IMPLEMENTS_static_assert
#define CXXOMFORT_IMPLEMENTS_static_assert CXXOMFORT_IMPLEMENTS_n1720


#endif

Changes to cxxomfort/cxxomfort/config.hpp.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
139
140
141
142
143
144
145


















146
147
148
149
150
151
152
 * 
 * If you are directly including this 
 * perhaps you meant to include <tt>cxxomfort/backports.hpp</tt>.
 * 
 */

//! Library version and release date as YYYYMMDD
#define CXXOMFORT_DATE 20200720UL
//! Defines the library version 
//! @deprecated 
#define CXXOMFORT_VERSION CXXOMFORT_DATE

#include "config/_pre.hpp"
#include "config/_support.hpp"

................................................................................
        #elif (CXXOMFORT_CXX_EMULATION >= 2017)
            #pragma message CXXO_NOTICE("emulation / c++1z mode (c++17)")
        #endif
        
    #endif // friendly notices

#endif



















//
// Macros that conditionally generate code for C++11, C++14
//

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_CXX11_CODE(cxx11,none) none







|







 







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







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
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
 * 
 * If you are directly including this 
 * perhaps you meant to include <tt>cxxomfort/backports.hpp</tt>.
 * 
 */

//! Library version and release date as YYYYMMDD
#define CXXOMFORT_DATE 20200724UL
//! Defines the library version 
//! @deprecated 
#define CXXOMFORT_VERSION CXXOMFORT_DATE

#include "config/_pre.hpp"
#include "config/_support.hpp"

................................................................................
        #elif (CXXOMFORT_CXX_EMULATION >= 2017)
            #pragma message CXXO_NOTICE("emulation / c++1z mode (c++17)")
        #endif
        
    #endif // friendly notices

#endif

// 
// cxxomfort independent implementation bases 
// 


#if (CXXO_COMPILER_SUPPORT_decltype)
	#undef  CXXOMFORT_IMPLEMENTS_n1978	
	#define CXXOMFORT_IMPLEMENTS_n1978 CXXO_IMPLSTATUS_NATIVE()
#elif (CXXO_COMPILER_SUPPORT_typeof)
	#undef  CXXOMFORT_IMPLEMENTS_n1978	
	#define CXXOMFORT_IMPLEMENTS_n1978 CXXO_IMPLSTATUS_EMULATION()
#else
	#undef  CXXOMFORT_IMPLEMENTS_n1978	
	#define CXXOMFORT_IMPLEMENTS_n1978 0
#endif



//
// Macros that conditionally generate code for C++11, C++14
//

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_CXX11_CODE(cxx11,none) none

Changes to cxxomfort/cxxomfort/config/_support.hpp.

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
 * 
 */



// backports

#if (CXXO_COMPILER_SUPPORT_decltype)
	#define CXXOMFORT_IMPLEMENTS_n1978 CXXO_IMPLSTATUS_NATIVE()
#elif (CXXO_COMPILER_SUPPORT_typeof)
	#define CXXOMFORT_IMPLEMENTS_n1978 CXXO_IMPLSTATUS_EMULATION()
#else
	#define CXXOMFORT_IMPLEMENTS_n1978 0
#endif
#define CXXOMFORT_IMPLEMENTS_n2343 CXXO_IMPLSTATUS_BACKPORT()


#define CXXOMFORT_IMPLEMENTS_std_array 0
#define CXXOMFORT_IMPLEMENTS_std_reference_wrapper 0
#define CXXOMFORT_IMPLEMENTS_std_remove_cvref 0

#define CXXOMFORT_IMPLEMENTS_string_view 0
#define CXXOMFORT_IMPLEMENTS_decltype CXXOMFORT_IMPLEMENTS_n1978
#define CXXOMFORT_IMPLEMENTS_destroy_at 0

#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors 0



#define CXXOMFORT_IMPLEMENTS_make_unique 0



#define CXXOMFORT_IMPLEMENTS_std_void_t 0



#define CXXOMFORT_IMPLEMENTS_tuple_get_type 0


#define CXXOMFORT_IMPLEMENTS_integral_constant_callable 0

// supplements
#define CXXOMFORT_IMPLEMENTS_array_ref 0
#define CXXOMFORT_IMPLEMENTS_foreach 0
#define CXXOMFORT_IMPLEMENTS_function_ref 0
#define CXXOMFORT_IMPLEMENTS_tuple_operations 0









|
|
|
|
|
|
<
|

>
|
|
|
>
|
|

>

>
>
>

>
>
>
|
>
>
>

>
>
|
>







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
 * 
 */



// backports

#define CXXOMFORT_IMPLEMENTS_attribute 0
#define CXXOMFORT_IMPLEMENTS_decltype 0
#define CXXOMFORT_IMPLEMENTS_explicit_operator 0
#define CXXOMFORT_IMPLEMENTS_foreach 0
#define CXXOMFORT_IMPLEMENTS_cstdint_integrals 0
#define CXXOMFORT_IMPLEMENTS_nullptr 0

#define CXXOMFORT_IMPLEMENTS_static_assert 0

#define CXXOMFORT_IMPLEMENTS_algorithm_isallanynoneof 0
#define CXXOMFORT_IMPLEMENTS_minmax 0
#define CXXOMFORT_IMPLEMENTS_array 0
#define CXXOMFORT_IMPLEMENTS_bind_front 0
#define CXXOMFORT_IMPLEMENTS_bool_constant 0
#define CXXOMFORT_IMPLEMENTS_byte 0
#define CXXOMFORT_IMPLEMENTS_common_type_fix 0
#define CXXOMFORT_IMPLEMENTS_destroy_at 0
#define CXXOMFORT_IMPLEMENTS_equal_mismatch_full_ranges 0
#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors 0
#define CXXOMFORT_IMPLEMENTS_integer_sequence 0
#define CXXOMFORT_IMPLEMENTS_integral_constant 0
#define CXXOMFORT_IMPLEMENTS_integral_constant_callable 0
#define CXXOMFORT_IMPLEMENTS_make_unique 0
#define CXXOMFORT_IMPLEMENTS_make_from_tuple 0
#define CXXOMFORT_IMPLEMENTS_random_substract_fix 0
#define CXXOMFORT_IMPLEMENTS_reference_wrapper 0
#define CXXOMFORT_IMPLEMENTS_ssize 0
#define CXXOMFORT_IMPLEMENTS_string_view 0
#define CXXOMFORT_IMPLEMENTS_timespec_get 0
#define CXXOMFORT_IMPLEMENTS_tuple_apply 0
#define CXXOMFORT_IMPLEMENTS_tuple_get_type 0

#define CXXOMFORT_IMPLEMENTS_std_remove_cvref 0
#define CXXOMFORT_IMPLEMENTS_std_void_t 0

// supplements
#define CXXOMFORT_IMPLEMENTS_array_ref 0
#define CXXOMFORT_IMPLEMENTS_foreach 0
#define CXXOMFORT_IMPLEMENTS_function_ref 0
#define CXXOMFORT_IMPLEMENTS_tuple_operations 0


Changes to cxxomfort/cxxomfort/cstddef.hpp.

77
78
79
80
81
82
83


84

85














86
 * See also: @ref cxxomfort-base , 
 * <a href="https://en.cppreference.com/w/cpp/header/cstddef">\<cstddef\> \@cppreference</a>.
 * 
 * Non-backport features (<tt>cxxomfort::fix</tt>):
 * 
 * * @c NULL_t - type of the value of @c NULL .
 * * @c to_byte() - obtain a <tt>byte</tt> value for a given integral.


 * 

 * 














 * **/







>
>

>

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

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
 * See also: @ref cxxomfort-base , 
 * <a href="https://en.cppreference.com/w/cpp/header/cstddef">\<cstddef\> \@cppreference</a>.
 * 
 * Non-backport features (<tt>cxxomfort::fix</tt>):
 * 
 * * @c NULL_t - type of the value of @c NULL .
 * * @c to_byte() - obtain a <tt>byte</tt> value for a given integral.
 * * @c to_integer() - obtain the value of a <tt>byte</tt>.
 * * @c to_value() - overload synonym for <tt>to_integral(std::byte)</tt>.
 * 
 * @section byte_conversion <tt>std::byte</tt> conversions
 * 
 * The library exposes the following names under <tt>cxxomfort::fix</tt> in order to work with variables of type <tt>byte</tt>:
 * 
 * @code
 * byte     b = cxxomfort::fix::to_byte('c'); // creates byte from uchar
 * unsigned c = cxxomfort::fix::to_integer(b); // obtains the uchar
 * unsigned d = cxxomfort::fix::to_value(b); // synonym for the above
 * 
 * @endcode
 * 
 * @section also See Also
 * 
 * * @see @cppref{header/cstddef}
 * * @see @cppref{types/byte} (C++17)
 * 
 * **/

Changes to cxxomfort/cxxomfort/cstdint.hpp.

10
11
12
13
14
15
16
17
18
19
20


21
22
23
24
25
26
27
28
29
30
..
51
52
53
54
55
56
57
58
59

60
61
62
63
64
65
66
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
 * 
 */


#include <cxxomfort/base.hpp>
#include <cxxomfort/cxxo-utils.hpp> // tinyint_
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <cstdint> support.")
#endif
#if (CXXOMFORT_CXX_STD>=2011)
#include <cstdint>


#else
//#include <inttypes.h>
#include <cxxomfort/base/cstdint.hpp>
#endif

// 
// tinyint
// ([u]uint8_t as an actual, functional numeric type)
// 

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

}

/**
 * @page std0cstdint <cstdint>
 * @brief Features related to Standard header <code>\<cstdint\></code>.
 * 
 * The features declared here include mostly the special type names 
 * for the supported integer ("integral") types:

 * 
 * * Candidate size integer typedefs <code>[u]int_least<em>n</em>_t</code> such as @c int_least32_t .
 * * Exact size integer typedefs <code>[u]int<em>n</em>_t</code> such as @c int32_t .
 * * Fast arithmetic integer typedefs <code>uint_fast<em>n</em>_t</code> such as @c int_fast32_t .
 * * Maximum-size integer typedef @c intmax_t , @c uintmax_t .
 * * Pointer-sized integer typedefs @c intptr_t , @c uintptr_t .
 * 
................................................................................
 * * @c cxxomfort::tinyint , @c cxxomfort::tinyuint - true numerical types with the same semantics of <tt>signed char, unsigned char</tt>.
 * * @c cxxomfort::fix::uint8_t - a true numeric integral type with the semantics of @c u8int_t .
 * 
 * For platforms without access to a Standard <code><stdint.h></code>, 
 * cxxomfort makes this possible by providing a copy of 
 * <em>pstdint.h the Portable stdint</em>.
 * 
 * @warning For the definition of these types, cxxomfort assumes that 
 * the native type <code>long long</code> is available, 
 * even in C++03 mode. Using a platform without such a native 
 * type is <b>unsupported</b> but can be tried by defining the 
 * @link cxxomfort-behaviour "Configuration macro" @endlink 
 * <code>CXXOFLAG_WITHOUT_LONGLONG</code>.
 * 
 * @section See Also
 * 
 * @see @cppref{header/cstdint} (cppreference) 
 * 
 * **/

#endif







|


|
>
>

|
|







 







|
|
>







 







|
<
<
|
<


|






10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
..
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
72
73
74
75
76
77
78
79


80

81
82
83
84
85
86
87
88
89
 * 
 */


#include <cxxomfort/base.hpp>
#include <cxxomfort/cxxo-utils.hpp> // tinyint_
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
	#pragma message CXXO_NOTICE("enabled <cstdint> support.")
#endif
#if (CXXOMFORT_CXX_STD>=2011)
	#include <cstdint>
	#undef  CXXOMFORT_IMPLEMENTS_cstdint_integrals
	#define CXXOMFORT_IMPLEMENTS_cstdint_integrals CXXO_IMPLSTATUS_NATIVE()
#else
	//#include <inttypes.h>
	#include <cxxomfort/base/cstdint.hpp>
#endif

// 
// tinyint
// ([u]uint8_t as an actual, functional numeric type)
// 

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

}

/**
 * @page std0cstdint <cstdint>
 * @brief Features related to Standard header <code>\<cstdint\></code>.
 * 
 * @section Interfaces
 * 
 * Features declared here include mostly the special type names for the supported integer ("integral") types that are defined by the compiler:
 * 
 * * Candidate size integer typedefs <code>[u]int_least<em>n</em>_t</code> such as @c int_least32_t .
 * * Exact size integer typedefs <code>[u]int<em>n</em>_t</code> such as @c int32_t .
 * * Fast arithmetic integer typedefs <code>uint_fast<em>n</em>_t</code> such as @c int_fast32_t .
 * * Maximum-size integer typedef @c intmax_t , @c uintmax_t .
 * * Pointer-sized integer typedefs @c intptr_t , @c uintptr_t .
 * 
................................................................................
 * * @c cxxomfort::tinyint , @c cxxomfort::tinyuint - true numerical types with the same semantics of <tt>signed char, unsigned char</tt>.
 * * @c cxxomfort::fix::uint8_t - a true numeric integral type with the semantics of @c u8int_t .
 * 
 * For platforms without access to a Standard <code><stdint.h></code>, 
 * cxxomfort makes this possible by providing a copy of 
 * <em>pstdint.h the Portable stdint</em>.
 * 
 * @warning For the definition of these types, cxxomfort assumes that the native type <code>long long</code> is available, even in C++03 mode. 


 * Using a platform without such type is <b>unsupported</b> but can be tried by defining the @link cxxomfort-behaviour "Configuration macro" @endlink 

 * <code>CXXOFLAG_WITHOUT_LONGLONG</code>.
 * 
 * @section also See Also
 * 
 * @see @cppref{header/cstdint} (cppreference) 
 * 
 * **/

#endif

Changes to cxxomfort/cxxomfort/ctime.hpp.

51
52
53
54
55
56
57

58
59
60
61
62
63
64
65

66
67
68
69
70
71
72
..
80
81
82
83
84
85
86

87
88
89
90
91
92
93
...
112
113
114
115
116
117
118

























119
120
121
122
123
124
125

	
/*
 * if in POSIX, we can just use their functions
 * when on Windows, we sandwich
 * */
	#if defined(_POSIX_VERSION)

		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_BACKPORT()

namespace cxxomfort { namespace cxxostd {
	using ::timespec;
	using ::timespec_get;
} }

	#elif defined(_WIN32)

		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_EMULATION()
namespace cxxomfort { namespace cxxostd {

	struct timespec {
		std::time_t tv_sec;
		long tv_nsec;
	};
................................................................................
		ts->tv_nsec= st.wMilliseconds * 1000UL * 1000UL; //static_cast<long>(st.wMilliseconds)*1000UL;
		return 0;
	}

} } // cxxomfort::cxxostd

	#else

		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_EMULATION()

namespace cxxomfort { namespace cxxostd {

	struct timespec {
		std::time_t tv_sec;
		long tv_nsec;
................................................................................
}

#else 


#endif // cxx_std


























#endif

#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {

/**
 * @ingroup cxx17-backports







>








>







 







>







 







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







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
..
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
...
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

	
/*
 * if in POSIX, we can just use their functions
 * when on Windows, we sandwich
 * */
	#if defined(_POSIX_VERSION)
		#undef  CXXOMFORT_IMPLEMENTS_timespec_get 
		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_BACKPORT()

namespace cxxomfort { namespace cxxostd {
	using ::timespec;
	using ::timespec_get;
} }

	#elif defined(_WIN32)
		#undef  CXXOMFORT_IMPLEMENTS_timespec_get 
		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_EMULATION()
namespace cxxomfort { namespace cxxostd {

	struct timespec {
		std::time_t tv_sec;
		long tv_nsec;
	};
................................................................................
		ts->tv_nsec= st.wMilliseconds * 1000UL * 1000UL; //static_cast<long>(st.wMilliseconds)*1000UL;
		return 0;
	}

} } // cxxomfort::cxxostd

	#else
		#undef  CXXOMFORT_IMPLEMENTS_timespec_get 
		#define CXXOMFORT_IMPLEMENTS_timespec_get CXXO_IMPLSTATUS_EMULATION()

namespace cxxomfort { namespace cxxostd {

	struct timespec {
		std::time_t tv_sec;
		long tv_nsec;
................................................................................
}

#else 


#endif // cxx_std

// 
// msleep 
// 

#if defined(_POSIX_VERSION)
	#include <time.h>
namespace cxxomfort {
	void msleep (uint32_t u) {
		usleep(u*1000);
	}
} // cxxomfort

#elif defined(_WIN32)
//	#include <windef.h>
//	#include <winbase.h>
//	#include <winsock2.h>
	#include <windows.h>
namespace cxxomfort {
	void msleep (uint32_t u) {
		Sleep(u);
	}
}

#endif

#endif

#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {

/**
 * @ingroup cxx17-backports

Changes to cxxomfort/cxxomfort/cxxomfort.hpp.

28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 *  <tt> @ref nullptr </tt>, <tt> @ref static_assert </tt> , <tt> @ref explicit_cast </tt> , @c move / rvalue-reference emulation , iterator accessors , alignof
 * <br/> @subpage cxxomfort-utils "Independent Utilities" @endlink
 *  </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 std0ctime "<ctime>" - @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 std0ios "<ios>" - @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>" 







|







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
 *  <tt> @ref nullptr </tt>, <tt> @ref static_assert </tt> , <tt> @ref explicit_cast </tt> , @c move / rvalue-reference emulation , iterator accessors , alignof
 * <br/> @subpage cxxomfort-utils "Independent Utilities" @endlink
 *  </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 std0ctime "<ctime>" - @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 std0ios "<ios>" - @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>" 

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

79
80
81
82
83
84
85
86
87
88
89
90

91
92
93
94
95
96



































 * 
 * See also: @ref cxx14-backports @ref cxx20-backports .
 * 
 */

/**
 * @page cxx20-backports
 * @brief Backports from C++20/2y/2z.
 * 
 * A listing of some of the features backported:
 * 
 * * From <tt><bit></tt> (mapped to <tt><type_traits></tt>): @c endian .

 * * From <tt>\<type_traits\></tt>: @c remove_cvref .
 * * From <tt>\<type_traits\></tt>: @c is_bounded_array , @c is_unbounded_array .
 *
 * See also: @ref cxx17-backports .
 * 
 */










































|




>
|





>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
 * 
 * See also: @ref cxx14-backports @ref cxx20-backports .
 * 
 */

/**
 * @page cxx20-backports
 * @brief Backports from C++20.
 * 
 * A listing of some of the features backported:
 * 
 * * From <tt><bit></tt> (mapped to <tt><type_traits></tt>): @c endian .
 * * From <tt>\<numeric\></tt>:  @c midpoint() .
 * * From <tt>\<type_traits\></tt>: @c type_identity , @c remove_cvref .
 * * From <tt>\<type_traits\></tt>: @c is_bounded_array , @c is_unbounded_array .
 *
 * See also: @ref cxx17-backports .
 * 
 */

/**
 * 
 * @page cxxo-macros
 * @brief Listing of support macros
 * 
 * The following macros determine what features does cxxomfort implement and whether it does 
 * so by forwarding to native facilities or by providing its own forms of emulation.
 * 
 * The possible values for these macros are:
 * 
 * * @c CXXO_IMPLSTATUS_NATIVE() -- cxxomfort doesn't do anything; instead, the compiler's native facility is in use.
 * * @c CXXO_IMPLSTATUS_BACKPORT() -- cxxomfort provides a @em backport of the given feature, using other facilities either already native or existing in cxxomfort.
 * * @c CXXO_IMPLSTATUS_EMULATION() -- cxxomfort provides an alternative or @em emulation of the given feature that differs in syntax, semantics and capabilities; most likely using a different name.
 * * @c 0 -- the feature is not supported, or the required header has not been included.
 * 
 * <table>
 * <tr><th>cxxomfort implementation macro</th><th>related <tt>__cpp</tt> macros</th><th>Notes</th>
 * </tr>
 * <tr>
 * 	<td><tt>CXXOMFORT_IMPLEMENTS_static_assert</tt></td> <td><tt>__cpp_static_assert</tt></td>
 * 	<td>Has a value other than @c 0 if the library implements <tt>static_assert</tt>.
 *  Has a value greater than @c 0 if the extension @c static_assert0 (omit message) is supported.
 *  </td>
 * </tr>
 *
 * <tr>
 * 	<td><tt>CXXOMFORT_IMPLEMENTS_foreach</tt></td> <td><tt>__cpp_range_based_for</tt></td>
 * 	<td>Has a value other than @c 0 if the library implements foreach loop emulation (see @c CXXO_FOREACH() ).
 *  </td>
 * </tr>
 *
 * </table>
 * 
 * */

Changes to cxxomfort/cxxomfort/functional.hpp.

10
11
12
13
14
15
16

17

18
19
20
21
22
23
24
...
100
101
102
103
104
105
106























107
108
109
110
111
112
113
...
147
148
149
150
151
152
153

154
155
156
157
158
159
160
...
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


#include <cxxomfort/base.hpp>
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
    #pragma message CXXO_NOTICE("enabled <functional> support.")
#endif


// invoking header


#if (CXXOMFORT_CXX_STD >= 2011)
	// nothing to do, <functional> already in 
#elif (CXXOMFORT_CXX_STD >= 1997 && CXXOMFORT_CXX_STD < 2011 && CXXOFLAG_tr1>0)
	// GCC has TR1 files under tr1/ and symbols under std::tr1::
	#if (CXXOFLAG_directory_tr1)
		#include <functional>
................................................................................
	//#pragma message CXXO_NOTICE("functional backports")
	#include "./impl/hash.hpp"
	#include "./impl/14-functional-transparent.hpp"
	#include "./impl/n4022-not_fn.hpp"
	// extra power for std::hash
#endif
























// 
// hash<> for unique_ptr (C++14)
//

#if (CXXOMFORT_CXX_STD>=2014)
#elif (CXXOMFORT_CXX_STD>=2011)
	#include <memory>
................................................................................
	#if CXXOFLAG_namespace_tr1
	}
	#endif

}

#endif


// 
// hash helper
// 


//#include "./umpl/03-restore_binders.hpp"
................................................................................

/**
 * @page std0functional <functional>
 * @brief Backports related to Standard header <tt><functional></tt> 
 * 
 * @code
 * #include <cxxomfort/functional.hpp>


 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)


 * Interfaces defined in this section:
 * 
 * * Bit functoids @c bit_and , @c bit_or , @c bit_xor (C++03, only for some cases).
 * * @link impl/14-functional-transparent.hpp Transparent / Heterogegenous Functors @endlink (C++14).
 * * @link cxxomfort::cxxostd::reference_wrapper reference_wrapper @endlink (C++03) and its assisting functions.
 * * @c not_fn() (C++17) - generalically negate any functor.
 * * @c invoke() (for C++11-onward only).

 * 
 * Interfaces repointed in this section when in TR1:
 * 
 * * @c std::reference_wrapper , @c std::ref() , @c std::cref()
 * * @c std::bind()  and related utilities.
 * * <tt>std::placeholders::_*</tt>
 * * @c std::mem_fn() 
 * * @c std::function
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * @link cxxomfort::fix::hash <tt>hash</tt> @endlink - Extra-power, specializable forwarder to @c std::hash .
 *
 * @subsection Notes 
 * 
 * @note <b>Cxxomfort</b> expects an implementation of <tt>std::reference_wrapper</tt> and related utilities to exist and function in order, as part of the general TR1 requirement.
 * 
 * @note <b>Cxxomfort</b> expects an implementation of <tt>std::bind</tt> and related utilities to exist and function in order, as part of the general TR1 requirement.
 * 
 * @section future "Planned for the future"
 * 
 * * Recovered function adaptors @c bind1st() , @c bind2nd() and @c ptr_fun (C++17/C++20).
 * 
 * @subsection also See Also
 * 
 * * @see @cppref{header/functional} 
 * * @see @ref cxxo-sup-functional (supplemental)
 * 
 */







>

>







 







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







 







>







 







>
>


<
>
>






|
>













|









|

|



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
...
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
...
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
...
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


#include <cxxomfort/base.hpp>
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
    #pragma message CXXO_NOTICE("enabled <functional> support.")
#endif

// 
// invoking header
// 

#if (CXXOMFORT_CXX_STD >= 2011)
	// nothing to do, <functional> already in 
#elif (CXXOMFORT_CXX_STD >= 1997 && CXXOMFORT_CXX_STD < 2011 && CXXOFLAG_tr1>0)
	// GCC has TR1 files under tr1/ and symbols under std::tr1::
	#if (CXXOFLAG_directory_tr1)
		#include <functional>
................................................................................
	//#pragma message CXXO_NOTICE("functional backports")
	#include "./impl/hash.hpp"
	#include "./impl/14-functional-transparent.hpp"
	#include "./impl/n4022-not_fn.hpp"
	// extra power for std::hash
#endif

// 
// unwrap_reference 
// 

#if (CXXOMFORT_CXX_STD>=2020)
#elif (CXXOMFORT_CXX_STD>=2007 || CXXOMFORT_CXX_EMULATION>=2011)
namespace cxxomfort { namespace cxxostd {

	template <typename T> struct unwrap_reference { 
		typedef T type;
	};
	template <typename T> struct unwrap_reference< std::reference_wrapper<T> >{
		typedef T& type;
	};

}} // cxxomfort::cxxostd

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

#endif

// 
// hash<> for unique_ptr (C++14)
//

#if (CXXOMFORT_CXX_STD>=2014)
#elif (CXXOMFORT_CXX_STD>=2011)
	#include <memory>
................................................................................
	#if CXXOFLAG_namespace_tr1
	}
	#endif

}

#endif


// 
// hash helper
// 


//#include "./umpl/03-restore_binders.hpp"
................................................................................

/**
 * @page std0functional <functional>
 * @brief Backports related to Standard header <tt><functional></tt> 
 * 
 * @code
 * #include <cxxomfort/functional.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 

 * @section Interfaces 
 * 
 * Interfaces defined in this section:
 * 
 * * Bit functoids @c bit_and , @c bit_or , @c bit_xor (C++03, only for some cases).
 * * @link impl/14-functional-transparent.hpp Transparent / Heterogegenous Functors @endlink (C++14).
 * * @link cxxomfort::cxxostd::reference_wrapper reference_wrapper @endlink (C++03) and its assisting functions.
 * * @c not_fn() (C++17) - generalically negate any functor.
 * * @c invoke() (C++17), for C++11-onward only.
 * * @c unwrap_reference (C++20).
 * 
 * Interfaces repointed in this section when in TR1:
 * 
 * * @c std::reference_wrapper , @c std::ref() , @c std::cref()
 * * @c std::bind()  and related utilities.
 * * <tt>std::placeholders::_*</tt>
 * * @c std::mem_fn() 
 * * @c std::function
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * @link cxxomfort::fix::hash <tt>hash</tt> @endlink - Extra-power, specializable forwarder to @c std::hash .
 *
 * @section Notes 
 * 
 * @note <b>Cxxomfort</b> expects an implementation of <tt>std::reference_wrapper</tt> and related utilities to exist and function in order, as part of the general TR1 requirement.
 * 
 * @note <b>Cxxomfort</b> expects an implementation of <tt>std::bind</tt> and related utilities to exist and function in order, as part of the general TR1 requirement.
 * 
 * @section future "Planned for the future"
 * 
 * * Recovered function adaptors @c bind1st() , @c bind2nd() and @c ptr_fun (C++17/C++20).
 * 
 * @section also See Also
 * 
 * * @see @cppref{header/functional} (cppreference) 
 * * @see @ref cxxo-sup-functional (supplemental)
 * 
 */

Changes to cxxomfort/cxxomfort/impl/07-array.hpp.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * 
 */
#include <cxxomfort/base.hpp>
#include <cxxomfort/impl/relationals.hpp>
#include CXXO_INCLUDE_SYS(iterator)
#include CXXO_INCLUDE_SYS(algorithm)
#define CXXOMFORT_IMPLEMENTS_n1479 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_std_array CXXOMFORT_IMPLEMENTS_n1479

namespace cxxomfort {
namespace cxxostd {
namespace array {

namespace detail {
    template <typename T>







|







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 * 
 */
#include <cxxomfort/base.hpp>
#include <cxxomfort/impl/relationals.hpp>
#include CXXO_INCLUDE_SYS(iterator)
#include CXXO_INCLUDE_SYS(algorithm)
#define CXXOMFORT_IMPLEMENTS_n1479 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_array CXXOMFORT_IMPLEMENTS_n1479

namespace cxxomfort {
namespace cxxostd {
namespace array {

namespace detail {
    template <typename T>

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

1
2
3
4
5
6
7


8
9
10
11
12
13
14
#ifndef CXXOMFORT_IMPL_MINMAX_HPP
#define CXXOMFORT_IMPL_MINMAX_HPP
/**
 * @file 
 */

#define CXXOMFORT_IMPLEMENTS_n1990 CXXO_IMPLSTATUS_BACKPORT()


#define CXXOMFORT_IMPLEMENTS_minmax CXXOMFORT_IMPLEMENTS_n1990

#include <cxxomfort/config.hpp>

namespace cxxomfort {
namespace cxxostd {








>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef CXXOMFORT_IMPL_MINMAX_HPP
#define CXXOMFORT_IMPL_MINMAX_HPP
/**
 * @file 
 */

#define CXXOMFORT_IMPLEMENTS_n1990 CXXO_IMPLSTATUS_BACKPORT()

#undef  CXXOMFORT_IMPLEMENTS_minmax
#define CXXOMFORT_IMPLEMENTS_minmax CXXOMFORT_IMPLEMENTS_n1990

#include <cxxomfort/config.hpp>

namespace cxxomfort {
namespace cxxostd {

Changes to cxxomfort/cxxomfort/impl/14-algorithm-equal.hpp.

8
9
10
11
12
13
14
15


16
17
18
19
20
21
22
#include "../algorithm.hpp"
#include "./07-type_traits.hpp"
#include "./11-conditional.hpp"
//#include <cxxomfort/type_traits.hpp>
// <algorithm> should have been included already

#define CXXOMFORT_IMPLEMENTS_n3671 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_two_ranges_equal_mismatch CXXOMFORT_IMPLEMENTS_n3671



namespace cxxomfort {
namespace cxxostd {

//
// explicit sized ranges for equal, from C++14
//







|
>
>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "../algorithm.hpp"
#include "./07-type_traits.hpp"
#include "./11-conditional.hpp"
//#include <cxxomfort/type_traits.hpp>
// <algorithm> should have been included already

#define CXXOMFORT_IMPLEMENTS_n3671 CXXO_IMPLSTATUS_BACKPORT()

#undef  CXXOMFORT_IMPLEMENTS_equal_mismatch_full_ranges
#define CXXOMFORT_IMPLEMENTS_equal_mismatch_full_ranges CXXOMFORT_IMPLEMENTS_n3671

namespace cxxomfort {
namespace cxxostd {

//
// explicit sized ranges for equal, from C++14
//

Changes to cxxomfort/cxxomfort/impl/14-functional-transparent.hpp.

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
...
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
...
226
227
228
229
230
231
232
233

234
235



236
 * * @c std::bit_or<void>
 * * @c std::bit_xor<void>
 *
 */


#include <cxxomfort/config.hpp>


#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_BACKPORT()
#if !defined(CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors)
	#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors CXXOMFORT_IMPLEMENTS_n3421
#endif






#include CXXO_INCLUDE_SYS(functional)
// <functional> needs to be #included for this to make any sense
#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
#pragma message CXXO_NOTICE("enabled <functional> transparent functors")
#endif

#include <cxxomfort/type_traits.hpp> // common_type
#include "../type_traits.hpp"
#include "../impl/11-common_type.hpp"

namespace cxxomfort {
................................................................................
// for the facilities to function correctly they are rebuilt in
// namespace std; but we give users the option not to.
#if (defined(CXXOFLAG_NO_STD_USING) && CXXOFLAG_NO_STD_USING>0 )
#else
/*
 * Transparent functors were established in C++14
 */
#if (CXXOMFORT_CXX_STD >= 2014 /* || CXXO_COMPILER_SUPPORT_functional_transparent */)
#else
namespace std {

    //! Transparent @em equal_to functor.
    template<> struct equal_to<void>  : ::cxxomfort::cxxostd::equal_to<void> {}; ///< transparent specialization for @c std::equal_to
    //! Transparent @em not_equal_to functor.
    template<> struct not_equal_to<void>  : ::cxxomfort::cxxostd::not_equal_to<void> {};
    //! Transparent @em less functor.
................................................................................
    template<> struct multiplies<void>   : ::cxxomfort::cxxostd::multiplies<void> {};
    //! Transparent @em divides functor.
    template<> struct divides<void>   : ::cxxomfort::cxxostd::divides<void> {};
    //! Transparent @em modulus functor.
    template<> struct modulus<void>   : ::cxxomfort::cxxostd::modulus<void> {};

}
#endif // c++14

#endif // no std




#endif // CXXOMFORT_EXTRAS_14FUNCTORS_HPP







|
|
|
|
|
|
|
>
>
>
>



|
|







 







|
<







 







|
>


>
>
>

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
...
195
196
197
198
199
200
201
202

203
204
205
206
207
208
209
...
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
 * * @c std::bit_or<void>
 * * @c std::bit_xor<void>
 *
 */


#include <cxxomfort/config.hpp>
#include <cxxomfort/base.hpp>

#if (CXXOMFORT_CXX_STD>=2014)
	#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_NATIVE()
#elif (CXXO_COMPILER_SUPPORT_functional_transparent)
	#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_NATIVE()
#elif (CXXOMFORT_CXX_STD>=1997)
	#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_BACKPORT()
#else
	#define CXXOMFORT_IMPLEMENTS_n3421 0 
#endif // cxx-std

#include CXXO_INCLUDE_SYS(functional)
// <functional> needs to be #included for this to make any sense
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
	#pragma message CXXO_NOTICE("enabled <functional> transparent functors")
#endif

#include <cxxomfort/type_traits.hpp> // common_type
#include "../type_traits.hpp"
#include "../impl/11-common_type.hpp"

namespace cxxomfort {
................................................................................
// for the facilities to function correctly they are rebuilt in
// namespace std; but we give users the option not to.
#if (defined(CXXOFLAG_NO_STD_USING) && CXXOFLAG_NO_STD_USING>0 )
#else
/*
 * Transparent functors were established in C++14
 */
	#if (CXXOMFORT_IMPLEMENTS_n3421 == CXXO_IMPLSTATUS_BACKPORT() )

namespace std {

    //! Transparent @em equal_to functor.
    template<> struct equal_to<void>  : ::cxxomfort::cxxostd::equal_to<void> {}; ///< transparent specialization for @c std::equal_to
    //! Transparent @em not_equal_to functor.
    template<> struct not_equal_to<void>  : ::cxxomfort::cxxostd::not_equal_to<void> {};
    //! Transparent @em less functor.
................................................................................
    template<> struct multiplies<void>   : ::cxxomfort::cxxostd::multiplies<void> {};
    //! Transparent @em divides functor.
    template<> struct divides<void>   : ::cxxomfort::cxxostd::divides<void> {};
    //! Transparent @em modulus functor.
    template<> struct modulus<void>   : ::cxxomfort::cxxostd::modulus<void> {};

}
	#endif // c++14

#endif // no std

#undef  CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors
#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors CXXOMFORT_IMPLEMENTS_n3421

#endif // CXXOMFORT_EXTRAS_14FUNCTORS_HPP

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

1
2
3


4
5
6
7
8
9
10
..
17
18
19
20
21
22
23


24
25
26
27
28
29
30
..
81
82
83
84
85
86
87


88
89
90
91
92
93
94
#ifndef CXXOMFORT_IMPL_14_INTEGER_SEQUENCE_HPP
#define CXXOMFORT_IMPL_14_INTEGER_SEQUENCE_HPP
#include <cxxomfort/config.hpp>


/**
 * @file
 */

// room here for a possible c++03 implementation? I wish.

#if (CXXOMFORT_CXX_STD>= 2014 || CXXO_COMPILER_SUPPORT_integer_sequence>0)
................................................................................
	using std::index_sequence;
	using std::make_index_sequence;
	using std::index_sequence_for;
} }

#elif (CXXOMFORT_CXX_STD >= 2011)
    #define CXXOMFORT_IMPLEMENTS_n3658 CXXO_IMPLSTATUS_BACKPORT()


    #define CXXOMFORT_IMPLEMENTS_integer_sequence CXXOMFORT_IMPLEMENTS_n3658

namespace cxxomfort { namespace cxxostd {

/**
 * @ingroup cxx14-backports
 * @{
................................................................................

#else
	// nothing to do
    #define CXXOMFORT_IMPLEMENTS_n3658 0

#endif





#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {

/**
 * @{



>
>







 







>
>







 







>
>







1
2
3
4
5
6
7
8
9
10
11
12
..
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef CXXOMFORT_IMPL_14_INTEGER_SEQUENCE_HPP
#define CXXOMFORT_IMPL_14_INTEGER_SEQUENCE_HPP
#include <cxxomfort/config.hpp>
#include <cxxomfort/base.hpp>

/**
 * @file
 */

// room here for a possible c++03 implementation? I wish.

#if (CXXOMFORT_CXX_STD>= 2014 || CXXO_COMPILER_SUPPORT_integer_sequence>0)
................................................................................
	using std::index_sequence;
	using std::make_index_sequence;
	using std::index_sequence_for;
} }

#elif (CXXOMFORT_CXX_STD >= 2011)
    #define CXXOMFORT_IMPLEMENTS_n3658 CXXO_IMPLSTATUS_BACKPORT()
    
    #undef  CXXOMFORT_IMPLEMENTS_integer_sequence
    #define CXXOMFORT_IMPLEMENTS_integer_sequence CXXOMFORT_IMPLEMENTS_n3658

namespace cxxomfort { namespace cxxostd {

/**
 * @ingroup cxx14-backports
 * @{
................................................................................

#else
	// nothing to do
    #define CXXOMFORT_IMPLEMENTS_n3658 0

#endif

#undef  CXXOMFORT_IMPLEMENTS_integer_sequence
#define CXXOMFORT_IMPLEMENTS_integer_sequence CXXOMFORT_IMPLEMENTS_n3658 


#ifdef DOXYGEN_DOC
namespace cxxomfort { namespace cxxostd {

/**
 * @{

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

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
    return get<N>(t);
}

} // std

#endif

#if !defined(CXXOMFORT_IMPLEMENTS_tuple_get_type)
	#define CXXOMFORT_IMPLEMENTS_tuple_get_type CXXOMFORT_IMPLEMENTS_n3584
#endif


// Implement interface for std::pair

/*
namespace std {








|
|
<







118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
    return get<N>(t);
}

} // std

#endif

#undef  CXXOMFORT_IMPLEMENTS_tuple_get_type
#define CXXOMFORT_IMPLEMENTS_tuple_get_type CXXOMFORT_IMPLEMENTS_n3584



// Implement interface for std::pair

/*
namespace std {

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

5
6
7
8
9
10
11


12
13
14
15
16
17
18
 * @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")
    #endif
#endif







>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 * @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()

#undef  CXXOMFORT_IMPLEMENTS_bool_constant
#define CXXOMFORT_IMPLEMENTS_bool_constant CXXOMFORT_IMPLEMENTS_n4334

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

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

5
6
7
8
9
10
11


12
13
14
15
16
17
18
..
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
...
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
...
188
189
190
191
192
193
194












195
196
197
198
199
200
201
202
...
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
 * @brief Implementation of std::byte 
 * 
 * Interfaces defined in this file: 
 * 
 * * @c @link byte byte @endlink (c++17)
 * * @c to_integer (c++17)
 * * @c to_byte (cxxomfort)


 * 
 * Implementations here are tied to @ref cstddef.hpp .
 * 
 */

/*
 * 
................................................................................
#elif (CXXOMFORT_CXX_STD>=1997) \
&& (CXXO_COMPILER_SUPPORT_explicit_operator)
	// if the compiler at least supports explicit conversion operators, 
	// we can implement std::byte using the typesafe_enum pattern.

	#define CXXOMFORT_IMPLEMENTS_p0298r3 CXXO_IMPLSTATUS_EMULATION()

#include "typesafe_enum-core.hpp"

namespace cxxomfort { namespace cxxostd {

struct byte;

namespace detail {

	struct mybyte_def { enum type {};  };
	typedef cxxomfort::impl::typesafe_enum<mybyte_def,unsigned char> byteimpl;

}

#pragma pack(push,1)
struct byte 
//: private detail::byteimpl 
{

    private:
    typedef detail::byteimpl impl_t;

    public:
    
    CXXO_EXPLICIT_OPERATOR(unsigned char) () const CXXO_NOEXCEPTNOTHROW {
		return explicit_cast<unsigned char>(impl);
	}
    
    private:
    impl_t impl;

};
#pragma pack(pop)

template <typename Integral>
Integral to_integer (byte b) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	static_assert (is_integral<Integral>::value, "to_integer");
	return explicit_cast<unsigned char>(b);
}
................................................................................
	// pre-C++11 if we don't have support for 
	// explicit operator
	// implement using a simple struct
	#define CXXOMFORT_IMPLEMENTS_p0298r3 3001

namespace cxxomfort { namespace cxxostd {

#pragma pack(push,1)
struct byte {
	public:
	
	CXXO_EXPLICIT_OPERATOR(unsigned char) () const CXXO_NOEXCEPT {
		return v;
	}

	private:
	unsigned char v;
};
#pragma pack(pop)

template <typename I>
I to_integer (byte b) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	return explicit_cast<unsigned char>(b);
	//I i= 0;
	//memcpy(&i, &b, 1);
................................................................................


} } // cxxomfort::cxxostd


#endif













	#define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3

// 
// internal checks 
// 

namespace cxxomfort { namespace cxxostd {

................................................................................
/** 
 * @struct byte
 * @brief Implements the backport for <tt>std::byte</tt>.
 * @see @ref std::byte
 * 
 * This implementation-defined struct implements the functionality 
 * for <tt>std::byte</tt> where required (eg.: in C++03 mode).











 * 
 * Only comparison operator, bit operations (via bitmask operators) and explicit 
 * conversion to <tt>unsigned char</tt> are defined for it. Just 
 * like <tt>std::byte</tt>, it has no value-taking constructors.
 * 
 * The implementation changes according to the language features 
 * that cxxomfort can find. In C++11 onwards mode, an actual 
 * <tt>enum class</tt> is used.
 * 






 * See @ref @c std::byte for more information.
 * */
struct byte {
	//! Stored value corresponding to one "byte" (implementation-defined).
	__implementation_defined_t value;
	//! Explicit conversion to <tt>unsigned char</tt> (implementation-defined).
	explicit operator unsigned char () const noexcept;
................................................................................
};

//! Compares the numerical expression of two bytes
inline bool operator== (byte, byte);

//! Compares the numerical expression of two bytes
inline bool operator!= (byte, byte);








} } // cxxomfort::cxxostd

namespace cxxomfort { namespace fix { 

/**
 * @brief Creates a @c std::byte value given a numerical octet value.







>
>







 







|












|

<

<




<








|







 







|










|







 







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







 







>
>
>
>
>
>
>
>
>
>
>









>
>
>
>
>
>







 







>
>
>
>
>
>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
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
...
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
...
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
...
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
 * @brief Implementation of std::byte 
 * 
 * Interfaces defined in this file: 
 * 
 * * @c @link byte byte @endlink (c++17)
 * * @c to_integer (c++17)
 * * @c to_byte (cxxomfort)
 * * @c to_value (cxxomfort)
 * 
 * 
 * Implementations here are tied to @ref cstddef.hpp .
 * 
 */

/*
 * 
................................................................................
#elif (CXXOMFORT_CXX_STD>=1997) \
&& (CXXO_COMPILER_SUPPORT_explicit_operator)
	// if the compiler at least supports explicit conversion operators, 
	// we can implement std::byte using the typesafe_enum pattern.

	#define CXXOMFORT_IMPLEMENTS_p0298r3 CXXO_IMPLSTATUS_EMULATION()

	#include "typesafe_enum-core.hpp"

namespace cxxomfort { namespace cxxostd {

struct byte;

namespace detail {

	struct mybyte_def { enum type {};  };
	typedef cxxomfort::impl::typesafe_enum<mybyte_def,unsigned char> byteimpl;

}

	#pragma pack(push,1)
struct byte 

{

    private:
    typedef detail::byteimpl impl_t;

    public:

    CXXO_EXPLICIT_OPERATOR(unsigned char) () const CXXO_NOEXCEPTNOTHROW {
		return explicit_cast<unsigned char>(impl);
	}
    
    private:
    impl_t impl;

};
	#pragma pack(pop)

template <typename Integral>
Integral to_integer (byte b) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	static_assert (is_integral<Integral>::value, "to_integer");
	return explicit_cast<unsigned char>(b);
}
................................................................................
	// pre-C++11 if we don't have support for 
	// explicit operator
	// implement using a simple struct
	#define CXXOMFORT_IMPLEMENTS_p0298r3 3001

namespace cxxomfort { namespace cxxostd {

	#pragma pack(push,1)
struct byte {
	public:
	
	CXXO_EXPLICIT_OPERATOR(unsigned char) () const CXXO_NOEXCEPT {
		return v;
	}

	private:
	unsigned char v;
};
	#pragma pack(pop)

template <typename I>
I to_integer (byte b) CXXO_NOEXCEPTNOTHROW {
	using namespace std;
	return explicit_cast<unsigned char>(b);
	//I i= 0;
	//memcpy(&i, &b, 1);
................................................................................


} } // cxxomfort::cxxostd


#endif

// to_value synonym

namespace cxxomfort { namespace cxxostd {

CXXO_CONSTEXPR static inline 
unsigned to_value (byte b) CXXO_NOEXCEPTNOTHROW {
	return to_integral(b);
}

}}

#undef  CXXOMFORT_IMPLEMENTS_byte 
#define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3

// 
// internal checks 
// 

namespace cxxomfort { namespace cxxostd {

................................................................................
/** 
 * @struct byte
 * @brief Implements the backport for <tt>std::byte</tt>.
 * @see @ref std::byte
 * 
 * This implementation-defined struct implements the functionality 
 * for <tt>std::byte</tt> where required (eg.: in C++03 mode).
 * 
 * In general, a <tt>byte</tt> is structured as follows:
 * 
 * @code
 * enum class byte : unsigned char {};
 * unsigned to_integral (byte); // implementation_defined
 * 
 * byte b = to_byte('c');
 * unsigned char uc = explicit_cast<unsigned char>(b);
 * 
 * @endcode
 * 
 * Only comparison operator, bit operations (via bitmask operators) and explicit 
 * conversion to <tt>unsigned char</tt> are defined for it. Just 
 * like <tt>std::byte</tt>, it has no value-taking constructors.
 * 
 * The implementation changes according to the language features 
 * that cxxomfort can find. In C++11 onwards mode, an actual 
 * <tt>enum class</tt> is used.
 * 
 * Except where explicitly indicated, all operations on <tt>byte</tt> are nothrow and (C++14) constexpr, including conversions to integrals.
 * 
 * The helper function @c to_byte() is used to construct a @c byte pre-C++17.
 * 
 * The helper functions @c to_integer() and @c to_value() can recover the value stored by a @c byte into an integral or <tt>unsigned char</tt> variable respectively.
 * 
 * See @ref @c std::byte for more information.
 * */
struct byte {
	//! Stored value corresponding to one "byte" (implementation-defined).
	__implementation_defined_t value;
	//! Explicit conversion to <tt>unsigned char</tt> (implementation-defined).
	explicit operator unsigned char () const noexcept;
................................................................................
};

//! Compares the numerical expression of two bytes
inline bool operator== (byte, byte);

//! Compares the numerical expression of two bytes
inline bool operator!= (byte, byte);

//! Converts the byte value into an @a Integral .
template <typename Integral>
Integral to_integer (byte b);

//! Converts the byte value into an <tt>unsigned char</tt>.
inline unsigned char to_value (byte b);

} } // cxxomfort::cxxostd

namespace cxxomfort { namespace fix { 

/**
 * @brief Creates a @c std::byte value given a numerical octet value.

Changes to cxxomfort/cxxomfort/impl/17-iterator_access.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
...
125
126
127
128
129
130
131
132

133
134
135
136
137
138
139

140
141
142
143
144
145
#ifndef CXXOMFORT_IMPL_17_SIZE_HPP
#define CXXOMFORT_IMPL_17_SIZE_HPP
/**
 * @file
 * @brief Implementation of std::size , std::data , std::empty 
 */
#include <cxxomfort/config.hpp>
#include <cxxomfort/base/iterator.hpp>
#include CXXO_INCLUDE_SYS(cstddef)

#define CXXOMFORT_IMPLEMENTS_n4017 CXXO_IMPLSTATUS_EMULATION()
#define CXXOMFORT_IMPLEMENTS_nonmember_size CXXOMFORT_IMPLEMENTS_n4017


// TODO fix "size" for compatibility with C++17's name
//
// From proposal N4017
//
// This implements a nonmember size() that calls member .size().
// For containers that somehow don't have size() (looking at you forward_list >_>)
// let's do distance(.begin(),.end())

namespace cxxomfort {
namespace cxxostd {
namespace iterator {

namespace detail_size {
template <typename C, bool F=false> struct call_size_has {
    typename C::difference_type operator() (C const& c) const { 
        return std::distance(c.begin() , c.end());
    }
}; // call_size_has
................................................................................
template <typename T>
constexpr bool empty (std::initializer_list<T> const& i) noexcept {
    return i.size()==0;
}
#endif


}}}


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

    #if (CXXOMFORT_CXX_STD < 2017)
    namespace std {
        using ::cxxomfort::cxxostd::iterator::size;

    }
    #endif

#endif // no std using

#endif
|
|










>











<







 







|
>






|
>






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
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#ifndef CXXOMFORT_IMPL_17_ITERATOR_ACCESS_HPP
#define CXXOMFORT_IMPL_17_ITERATOR_ACCESS_HPP
/**
 * @file
 * @brief Implementation of std::size , std::data , std::empty 
 */
#include <cxxomfort/config.hpp>
#include <cxxomfort/base/iterator.hpp>
#include CXXO_INCLUDE_SYS(cstddef)

#define CXXOMFORT_IMPLEMENTS_n4017 CXXO_IMPLSTATUS_EMULATION()
#define CXXOMFORT_IMPLEMENTS_nonmember_size CXXOMFORT_IMPLEMENTS_n4017


// TODO fix "size" for compatibility with C++17's name
//
// From proposal N4017
//
// This implements a nonmember size() that calls member .size().
// For containers that somehow don't have size() (looking at you forward_list >_>)
// let's do distance(.begin(),.end())

namespace cxxomfort {
namespace cxxostd {


namespace detail_size {
template <typename C, bool F=false> struct call_size_has {
    typename C::difference_type operator() (C const& c) const { 
        return std::distance(c.begin() , c.end());
    }
}; // call_size_has
................................................................................
template <typename T>
constexpr bool empty (std::initializer_list<T> const& i) noexcept {
    return i.size()==0;
}
#endif


}} // cxxomfort::cxxostd


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

    #if (CXXOMFORT_CXX_STD < 2017)
    namespace std {
        using ::cxxomfort::cxxostd::size;
        using ::cxxomfort::cxxostd::empty;
    }
    #endif

#endif // no std using

#endif

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

12
13
14
15
16
17
18

19
20
21
22
23
24
25
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_NATIVE()
#elf (CXXOMFORT_CXX_STD >= 2011)
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_BACKPORT()
#else
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_EMULATION()
#endif


#define CXXOMFORT_IMPLEMENTS_make_from_tuple CXXOMFORT_IMPLEMENTS_p0209 

namespace cxxomfort {
namespace cxxostd {

// 
// make_from_tuple







>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_NATIVE()
#elf (CXXOMFORT_CXX_STD >= 2011)
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_BACKPORT()
#else
	#define CXXOMFORT_IMPLEMENTS_p0209 CXXO_IMPLSTATUS_EMULATION()
#endif

#undef  CXXOMFORT_IMPLEMENTS_make_from_tuple
#define CXXOMFORT_IMPLEMENTS_make_from_tuple CXXOMFORT_IMPLEMENTS_p0209 

namespace cxxomfort {
namespace cxxostd {

// 
// make_from_tuple

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

12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Interfaces defined in this header:
 * 
 * * std::apply (function_type, tuple<...>)
 * 
 */

#define CXXOMFORT_IMPLEMENTS_n3829 CXXO_IMPLSTATUS_EMULATION()


#define CXXOMFORT_IMPLEMENTS_tuple_apply CXXOMFORT_IMPLEMENTS_n3829

#if (defined(CXXOMFORT_NOTICES))
    #if (CXXOMFORT_NOTICES > 1)
    #pragma message CXXO_NOTICE("enabled tuple apply(fn,tuple) implementation")
    #endif
#endif







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Interfaces defined in this header:
 * 
 * * std::apply (function_type, tuple<...>)
 * 
 */

#define CXXOMFORT_IMPLEMENTS_n3829 CXXO_IMPLSTATUS_EMULATION()

#undef  CXXOMFORT_IMPLEMENTS_tuple_apply
#define CXXOMFORT_IMPLEMENTS_tuple_apply CXXOMFORT_IMPLEMENTS_n3829

#if (defined(CXXOMFORT_NOTICES))
    #if (CXXOMFORT_NOTICES > 1)
    #pragma message CXXO_NOTICE("enabled tuple apply(fn,tuple) implementation")
    #endif
#endif

Added cxxomfort/cxxomfort/impl/20-iterator_access.hpp.











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef CXXOMFORT_IMPL_20_ITERATOR_ACCESS_HPP
#define CXXOMFORT_IMPL_20_ITERATOR_ACCESS_HPP
/**
 * @file
 * @brief Implementation of std::size , std::data , std::empty 
 */
#include <cxxomfort/config.hpp>
#include <cxxomfort/base/iterator.hpp>

#include <cxxomfort/impl/p1227r0-ssize.hpp>

	#if (defined(CXXOFLAG_NO_STD_USING) && CXXOFLAG_NO_STD_USING>0 )
	#elif (CXXOMFORT_IMPLEMENTS_ssize == CXXO_IMPLSTATUS_BACKPORT() || CXXOMFORT_IMPLEMENTS_ssize == CXXO_IMPLSTATUS_EMULATION() )
namespace std {
	using ::cxxomfort::cxxostd::ssize;
}

	#endif

#endif

Changes to cxxomfort/cxxomfort/impl/20-type_identity.hpp.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <cxxomfort/config.hpp>

// https://en.cppreference.com/w/cpp/types/type_identity

namespace cxxomfort {
namespace cxxostd {

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

}} // cxxomfort::std

#if (CXXOMFORT_CXX_STD<2020 && CXXOMFORT_CXX_EMULATION<2020)
namespace std { 
	using cxxomfort::cxxostd::type_identity; 
}

#else

#endif

#endif







<
<
<
<




|







4
5
6
7
8
9
10




11
12
13
14
15
16
17
18
19
20
21
22
#include <cxxomfort/config.hpp>

// https://en.cppreference.com/w/cpp/types/type_identity

namespace cxxomfort {
namespace cxxostd {





}} // cxxomfort::std

#if (CXXOMFORT_CXX_STD<2020 && CXXOMFORT_CXX_EMULATION<2020)
namespace std { 
	using cxxomfort::traits::type_identity; 
}

#else

#endif

#endif

Changes to cxxomfort/cxxomfort/impl/foreach_artima.hpp.

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

//#include <functional>
#include <cxxomfort/base.hpp>
#include <cxxomfort/base/iterator.hpp> // global begin, end
#include <cxxomfort/util/meta.hpp>
#include <valarray>

namespace cxxomfort {
namespace impl {
namespace detail {

///////////////////////////////////////////////////////////////////////////////







<







7
8
9
10
11
12
13

14
15
16
17
18
19
20
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

//#include <functional>
#include <cxxomfort/base.hpp>
#include <cxxomfort/base/iterator.hpp> // global begin, end

#include <valarray>

namespace cxxomfort {
namespace impl {
namespace detail {

///////////////////////////////////////////////////////////////////////////////

Changes to cxxomfort/cxxomfort/impl/foreach_gcc.hpp.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

//#include <functional>
#include <cxxomfort/config.hpp>
#include <cxxomfort/base/iterator.hpp> // global begin, end
#include <cxxomfort/impl/07-type_traits.hpp>
#include <cxxomfort/util/meta.hpp>
//#include <cxxomfort/using.hpp>
//#include <cxxomfort/memory.hpp> // alignof, aligned_storage

namespace cxxomfort {
namespace impl {

template <typename T> struct impl_is_array { enum { value = false }; };







<







8
9
10
11
12
13
14

15
16
17
18
19
20
21
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)

//#include <functional>
#include <cxxomfort/config.hpp>
#include <cxxomfort/base/iterator.hpp> // global begin, end
#include <cxxomfort/impl/07-type_traits.hpp>

//#include <cxxomfort/using.hpp>
//#include <cxxomfort/memory.hpp> // alignof, aligned_storage

namespace cxxomfort {
namespace impl {

template <typename T> struct impl_is_array { enum { value = false }; };

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

105
106
107
108
109
110
111


112










113
114
115
116
117
118
119
120
//
/*
 * function_caller wrapps a C function into a 
 * zero-cost callable unique.
 * eg.:
 * function_caller< int() , &rand > makerand;
 * 


 * */










#if (CXXOMFORT_CXX_STD >= 2011)
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; }








>
>

>
>
>
>
>
>
>
>
>
>
|







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
//
/*
 * function_caller wrapps a C function into a 
 * zero-cost callable unique.
 * eg.:
 * function_caller< int() , &rand > makerand;
 * 
 * originates in https://dev.krzaq.cc/post/you-dont-need-a-stateful-deleter-in-your-unique_ptr-usually/
 * 
 * */
#if (CXXOMFORT_CXX_STD>=2011)
template<typename Fn, Fn const * fn>
struct function_caller {
	template <typename... Args>
	auto operator() (Args&&... args) const
        -> decltype(fn(std::forward<Args...>(args...)))
    {
        return fn(std::forward<Args...>(args...));
    }
};
#elif (CXXOMFORT_CXX_STD >= 2011)
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; }

Changes to cxxomfort/cxxomfort/impl/n3334-array_ref.hpp.

123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	constexpr array_ref& operator= (array_ref const&) noexcept = default; //!< trivial assignment operator
#endif
#if (CXXOMFORT_CXX_STD>=2011)
    constexpr array_ref () noexcept = default;
    constexpr array_ref (array_ref const&) noexcept = default;
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC && CXXOMFORT_COMPILER_VERSION < 700) 
    array_ref& operator= (array_ref const&) noexcept = default;
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG && CXXOMFORT_COMPILER_VERSION < 500)
	array_ref& operator= (array_ref const&) = default;
    #else
    constexpr array_ref& operator= (array_ref const&) noexcept = default;    
    #endif
#else // pre-c++11 constructors
    array_ref () CXXO_NOEXCEPTNOTHROW 
    : ptr_(nullptr), len_(0) 







|







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
	constexpr array_ref& operator= (array_ref const&) noexcept = default; //!< trivial assignment operator
#endif
#if (CXXOMFORT_CXX_STD>=2011)
    constexpr array_ref () noexcept = default;
    constexpr array_ref (array_ref const&) noexcept = default;
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC && CXXOMFORT_COMPILER_VERSION < 700) 
    array_ref& operator= (array_ref const&) noexcept = default;
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG && CXXOMFORT_COMPILER_VERSION < 700)
	array_ref& operator= (array_ref const&) = default;
    #else
    constexpr array_ref& operator= (array_ref const&) noexcept = default;    
    #endif
#else // pre-c++11 constructors
    array_ref () CXXO_NOEXCEPTNOTHROW 
    : ptr_(nullptr), len_(0) 

Changes to cxxomfort/cxxomfort/impl/n4031_make_array.hpp.

1
2
3
4
5
6
7

8
9
10
11
12
13
14
#ifndef CXXOMFORT_IMPL_n4031_HPP
#define CXXOMFORT_IMPL_n4031_HPP

#include "../config.hpp"
#include "../base.hpp" // move emulation
#include <cxxomfort/utility.hpp>
#include <cxxomfort/array.hpp>

#include <iostream>

//
// make_array
// contructs an object of std::array<T,N> type with automatically calculated N.
// See proposal:  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4031.html
//







>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#ifndef CXXOMFORT_IMPL_n4031_HPP
#define CXXOMFORT_IMPL_n4031_HPP

#include "../config.hpp"
#include "../base.hpp" // move emulation
#include <cxxomfort/utility.hpp>
#include <cxxomfort/array.hpp>
#include <cxxomfort/impl/07-type_traits.hpp> // decay
#include <iostream>

//
// make_array
// contructs an object of std::array<T,N> type with automatically calculated N.
// See proposal:  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2014/n4031.html
//

Changes to cxxomfort/cxxomfort/impl/p1227r0-ssize.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
#ifndef CXXOMFORT_IMPL_p1227_HPP
#define CXXOMFORT_IMPL_p1227_HPP

/**
 * @file
 * @brief Implements part of p1227r0, a proposal for a general (non-member) unsigned size function



 * */

#include <cxxomfort/cstddef.hpp>
#include <cxxomfort/iterator.hpp>



#define CXXO_IMPLEMENTS_p1227r0 CXXO_IMPLSTATUS_LIBRARY()


#define CXXO_IMPLEMENTS_ssize CXXO_IMPLEMENTS_p1227r0


// see: https://wg21.link/p1227r0






























































namespace cxxomfort { namespace impl {


/**
 * Returns the @e size of a sequence-like object, as 
 * calculated by a call to <code>.size()</code>, 
 * converted to a @c difference_type .
 * 
 * @ingroup cxxo-sup-iterator






>
>
>


|
|

>
>
|
>
>
|
>

<
>

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

>







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
#ifndef CXXOMFORT_IMPL_p1227_HPP
#define CXXOMFORT_IMPL_p1227_HPP

/**
 * @file
 * @brief Implements part of p1227r0, a proposal for a general (non-member) unsigned size function
 * 
 * see: https://wg21.link/p1227r0

 * */

#include <cxxomfort/config.hpp>
#include <cxxomfort/cstddef.hpp>

#if (CXXOMFORT_CXX_STD >= 2020)
	#undef  CXXOMFORT_IMPLEMENTS_p1227r0
	#define CXXOMFORT_IMPLEMENTS_p1227r0 CXXO_IMPLSTATUS_NATIVE()
#elif (CXXOMFORT_CXX_STD >= 2014)
	#pragma message("ssize 2014")
	#undef  CXXOMFORT_IMPLEMENTS_p1227r0
	#define CXXOMFORT_IMPLEMENTS_p1227r0 CXXO_IMPLSTATUS_BACKPORT()


namespace cxxomfort { namespace cxxostd {

template <typename C>
constexpr auto ssize (C const& c) 
-> typename std::common_type< std::ptrdiff_t, typename std::make_signed<decltype(c.size()) >::type >::type
{
	using R = typename std::common_type< std::ptrdiff_t, typename std::make_signed<decltype(c.size())>::type >::type;
	return static_cast<R>(c.size());
}

// for arrays
template <typename T, std::ptrdiff_t N>
constexpr std::ptrdiff_t ssize (T const (&array)[N]) noexcept {
	return N;
}

} }

#elif (CXXOMFORT_CXX_STD >= 2011)
	#undef  CXXOMFORT_IMPLEMENTS_p1227r0
	#define CXXOMFORT_IMPLEMENTS_p1227r0 CXXO_IMPLSTATUS_EMULATION()

namespace cxxomfort { namespace cxxostd {

template <typename C>
constexpr typename std::make_signed< decltype( std::declval<C>().size() )>::type ssize (C const& c) {
	return (c.size());
}

// for arrays
template <typename T, std::ptrdiff_t N>
constexpr std::ptrdiff_t ssize (T const (&array)[N]) noexcept {
	return N;
}

} }

#elif (CXXOMFORT_CXX_STD >= 1997)
	#undef  CXXOMFORT_IMPLEMENTS_p1227r0
	#define CXXOMFORT_IMPLEMENTS_p1227r0 CXXO_IMPLSTATUS_EMULATION()

namespace cxxomfort { namespace cxxostd {

template <typename C>
std::ptrdiff_t ssize (C const& c) {
	return static_cast<std::ptrdiff_t>(c.size());
}

// for arrays
template <typename T, std::ptrdiff_t N>
std::ptrdiff_t ssize (T const (&array)[N]) CXXO_NOEXCEPTNOTHROW {
	return N;
}

} }

#endif

#undef  CXXOMFORT_IMPLEMENTS_ssize 
#define CXXOMFORT_IMPLEMENTS_ssize CXXOMFORT_IMPLEMENTS_p1227r0


namespace cxxomfort { namespace impl {


/**
 * Returns the @e size of a sequence-like object, as 
 * calculated by a call to <code>.size()</code>, 
 * converted to a @c difference_type .
 * 
 * @ingroup cxxo-sup-iterator

Changes to cxxomfort/cxxomfort/impl/unique_ptr-poor.hpp.

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

#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 "../impl/07-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








<







4
5
6
7
8
9
10

11
12
13
14
15
16
17

#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 "../impl/07-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

Changes to cxxomfort/cxxomfort/impl/unique_ptr.hpp.

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
    #define CXXOMFORT_USING_unique_ptr
#endif

#if (defined (CXXOMFORT_USING_unique_ptr))
    #define CXXOMFORT_IMPLEMENTS_unique_ptr CXXO_IMPLSTATUS_BACKPORT()

#include "../base.hpp" // nullptr, static_assert, move, forward
#include "../util/meta.hpp"
#include "../impl/07-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 emulation")
#endif








<







35
36
37
38
39
40
41

42
43
44
45
46
47
48
    #define CXXOMFORT_USING_unique_ptr
#endif

#if (defined (CXXOMFORT_USING_unique_ptr))
    #define CXXOMFORT_IMPLEMENTS_unique_ptr CXXO_IMPLSTATUS_BACKPORT()

#include "../base.hpp" // nullptr, static_assert, move, forward

#include "../impl/07-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 emulation")
#endif

Changes to cxxomfort/cxxomfort/ios.hpp.

61
62
63
64
65
66
67






68
69
70
71


72
73
74
75
76
77
78

#endif

/**
 * @page std0ios <ios>
 * @brief Backports related to Standard header <tt><ios></tt> 
 * 






 * C++03 and onwards don't usually need anything to be done for 
 * <tt><ios></tt>; however for some older compilers that are missing out 
 * on the full ios interface this header provides some
 * fixes and missing std names.


 * 
 * Interfaces defined in this section:
 * 
 * * @c io_errc (C++11).
 * * <tt>is_error_code_enum<io_errc></tt> (C++11).
 * * @c left , @c right (C++98) for Open Watcom.
 * 







>
>
>
>
>
>




>
>







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

#endif

/**
 * @page std0ios <ios>
 * @brief Backports related to Standard header <tt><ios></tt> 
 * 
 * @code
 * #include <cxxomfort/ios.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 
 * C++03 and onwards don't usually need anything to be done for 
 * <tt><ios></tt>; however for some older compilers that are missing out 
 * on the full ios interface this header provides some
 * fixes and missing std names.
 * 
 * @section Interfaces 
 * 
 * Interfaces defined in this section:
 * 
 * * @c io_errc (C++11).
 * * <tt>is_error_code_enum<io_errc></tt> (C++11).
 * * @c left , @c right (C++98) for Open Watcom.
 * 

Changes to cxxomfort/cxxomfort/iterator.hpp.

7
8
9
10
11
12
13




14
15
16
17
18
19
20
..
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
...
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
 *
 */


#include "base.hpp"
#include CXXO_INCLUDE_SYS(iterator)
#include "base/iterator.hpp"





namespace cxxomfort { namespace cxxostd {

/**
 * @brief A tag type that describes contiguous access iterators.
 * */
struct contiguous_iterator_tag : public std::random_access_iterator_tag {};
................................................................................



//#include 
// globals size, data, empty from C++17
#include "impl/14-iterator_access.hpp" // cbegin, cend
#include "impl/17-iterator_access.hpp" // size, data, empty


// 
// contiguous_access, contiguous_access_iterator
// 

#if (CXXOMFORT_CXX_STD >= 1997)
namespace cxxomfort { namespace fix { 
................................................................................

/**
 * @page std0iterator <iterator>
 * @brief Backports related to Standard header <tt><iterator></tt> 
 * 
 * @code
 * #include <cxxomfort/iterator.hpp>


 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)


 * Interfaces defined in this section:
 * 
 * * @c begin() , @c end() accessors (C++11).
 * * @c rbegin() , @c rend() accessors (C++14).
 * * @c cbegin() , @c cend() accessors (C++14).
 * * @c make_reverse_iterator() (C++14).
 * * @c size() accessor (C++17).
 * * @c data() accessor (C++17).
 * * @c empty() accessor (C++17).
 * * @c contiguous_iterator_tag (C++20).
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * @link cxxomfort::fix::is_contiguous_access_iterator <tt>is_contiguous_access_iterator</tt> @endlink - A check for contiguous access iterators.
 *
 * @subsection Contiguous Access Iterator
 * 
 * @e PENDING
 * 
 * @subsection also See Also
 * 
 * * @see @cppref{header/iterator} (cppreference)
 * * @see @ref cxxo-sup-iterator 
 * 
 * */







>
>
>
>







 







|







 







>
>


<
>
>


|












|



|





7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
...
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
 *
 */


#include "base.hpp"
#include CXXO_INCLUDE_SYS(iterator)
#include "base/iterator.hpp"

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

namespace cxxomfort { namespace cxxostd {

/**
 * @brief A tag type that describes contiguous access iterators.
 * */
struct contiguous_iterator_tag : public std::random_access_iterator_tag {};
................................................................................



//#include 
// globals size, data, empty from C++17
#include "impl/14-iterator_access.hpp" // cbegin, cend
#include "impl/17-iterator_access.hpp" // size, data, empty
#include "impl/20-iterator_access.hpp" // ssize

// 
// contiguous_access, contiguous_access_iterator
// 

#if (CXXOMFORT_CXX_STD >= 1997)
namespace cxxomfort { namespace fix { 
................................................................................

/**
 * @page std0iterator <iterator>
 * @brief Backports related to Standard header <tt><iterator></tt> 
 * 
 * @code
 * #include <cxxomfort/iterator.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 

 * @section Interfaces
 * 
 * Interfaces defined in this section:
 * 
 * * @c begin() , @c end() accessors (C++11) (also in cxxomfort base).
 * * @c rbegin() , @c rend() accessors (C++14).
 * * @c cbegin() , @c cend() accessors (C++14).
 * * @c make_reverse_iterator() (C++14).
 * * @c size() accessor (C++17).
 * * @c data() accessor (C++17).
 * * @c empty() accessor (C++17).
 * * @c contiguous_iterator_tag (C++20).
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * @link cxxomfort::fix::is_contiguous_access_iterator <tt>is_contiguous_access_iterator</tt> @endlink - A check for contiguous access iterators.
 *
 * @section Contiguous Access Iterator
 * 
 * @e PENDING
 * 
 * @section also See Also
 * 
 * * @see @cppref{header/iterator} (cppreference)
 * * @see @ref cxxo-sup-iterator 
 * 
 * */

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

270
271
272
273
274
275
276
277
278

279
280
281
282
283
284
285
286
...
294
295
296
297
298
299
300

301
302
303
304
305
306
307
...
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
 * 
 * See also: @c fix_inversion().
 * 
**/
template <typename Iter, typename Less> inline
Iter find_inversion (Iter ini, Iter fin, Less lt) {
    using namespace std;
    for (; ini != fin && next(ini,1) != fin; ++ini) {
        Iter inext= ini; ++inext;

        if (fin != inext && lt(*inext,*ini)) break;
    }
    return ini;
}

//! @overload find_inversion 
template <typename Iter> inline
Iter find_inversion (Iter ini, Iter fin) {
................................................................................
 * @xrefitem cxxo-sup-algorithm "" "Sorting"
 * 
 * See also: @c find_inversion().
 * 
**/
template <typename Iter, typename Less> inline
Iter fix_inversion (Iter ini, Iter fin, Less m) {

    Iter inv = find_inversion(ini,fin,m);
    if (inv!=fin) {
        iter_swap(inv, next(inv));
    }
    return inv;
}

................................................................................
 * @brief Checks if none of the predicates checks for @a value .
 * @ingroup cxxo-sup-algorithm
 * @return @c true if all of [ini,...,fin) evaluates @c true for @a value .
 * */
template <typename T, typename FncIter>
bool none_on (FncIter ini, FncIter fin, T const& value) {
	for (; ini != fin; ++ini) {
		if ((*ini)(value)==true) return false;
	}
	return true;
}


#endif








|
|
>
|







 







>







 







|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
...
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
...
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
 * 
 * See also: @c fix_inversion().
 * 
**/
template <typename Iter, typename Less> inline
Iter find_inversion (Iter ini, Iter fin, Less lt) {
    using namespace std;
    for (; ini != fin && next(ini) != fin; ++ini) {
		Iter nx= next(ini);
		if (nx==fin) return fin;
        else if (lt(*nx,*ini)) break;
    }
    return ini;
}

//! @overload find_inversion 
template <typename Iter> inline
Iter find_inversion (Iter ini, Iter fin) {
................................................................................
 * @xrefitem cxxo-sup-algorithm "" "Sorting"
 * 
 * See also: @c find_inversion().
 * 
**/
template <typename Iter, typename Less> inline
Iter fix_inversion (Iter ini, Iter fin, Less m) {
	using namespace std;
    Iter inv = find_inversion(ini,fin,m);
    if (inv!=fin) {
        iter_swap(inv, next(inv));
    }
    return inv;
}

................................................................................
 * @brief Checks if none of the predicates checks for @a value .
 * @ingroup cxxo-sup-algorithm
 * @return @c true if all of [ini,...,fin) evaluates @c true for @a value .
 * */
template <typename T, typename FncIter>
bool none_on (FncIter ini, FncIter fin, T const& value) {
	for (; ini != fin; ++ini) {
		if ((*ini)(value)) return false;
	}
	return true;
}


#endif

Changes to cxxomfort/cxxomfort/library/fixed_vector.hpp.

94
95
96
97
98
99
100
101
102
















103

104
105


106
107
108
109
110
111
112
...
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
...
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
...
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
    typedef std::reverse_iterator<iterator> reverse_iterator;  //!< reverse @c iterator type.
    typedef std::reverse_iterator<const_iterator> const_reverse_iterator; //!< reverse @c const_iterator type.

    public:

	//! Default constructor. Sets up an empty (unusable) fixed-vector.
    fixed_vector ()
	: m_p ( nullptr ), m_sz(0)
	{}
















    explicit fixed_vector (size_type N);     //!< (1) count-constructor

    fixed_vector (size_type N, T const& v);  //!< (3) count-constructor
    fixed_vector (fixed_vector const &V);         //!< (5) copy-constructor


    //! iterator-constructor
    template <typename It>
    fixed_vector (It ini, It fin, typename std::enable_if<is_iterator<It>::value,bool>::type* = nullptr);

#if (CXXOMFORT_CXX_STD >= 2011) || defined(DOXYGEN_DOC)
	/** 
	 * (7) initializer_list-ctor
................................................................................
    // Information
    ////////
    
	//! Maximum allowed size (as per allocator).
    CXXO_CONSTEXPR 
    size_type       max_size () const CXXO_NOEXCEPTNOTHROW { return m_sz; } 
    //! Current ( = maxium) size.
    CXXO_CONSTEXPR
    size_type       size () const CXXO_NOEXCEPTNOTHROW { return m_sz; }
    //! Check if container is empty ( = has @c size == 0).
    CXXO_CONSTEXPR
    bool            empty () const CXXO_NOEXCEPTNOTHROW { return m_p == nullptr && m_sz == 0; } 
	//! Access to the data pointer.
    const T*        data () const CXXO_NOEXCEPTNOTHROW { return m_p; }
    //! Access to the data pointer.
    T*              data () CXXO_NOEXCEPTNOTHROW { return m_p; }

    //! Unchecked (!) direct access to elements

    const_reference operator[] (size_type idx) const CXXO_NOEXCEPTNOTHROW {
        return m_p[idx];
    }
    //! @overload operator[]
    reference operator[] (size_type idx) CXXO_NOEXCEPTNOTHROW {
        return m_p[idx];
    }
................................................................................
        for (iterator i= this->begin(); i != this->end(); ++i) {*i= v;}
    }

    //! swap with another @c fixed_vector 
    void swap (fixed_vector<T,Alloc> & rhs) {
        std::swap(this->m_p, rhs.m_p);
        std::swap(this->m_sz, rhs.m_sz);
        //std::swap(this->m_a, rhs.m_a);
    }

// unimplemented
#if 0
#endif


    private:
    size_type m_sz;
    T* m_p;
    //Alloc m_a;

    T* alloc (size_type n) {
        return reinterpret_cast<T*>( new char [n * sizeof(T)] );
    }
    
    void release (size_type n) {

        (void)n;
    }

};

//
// copy constructor
//
template <typename T, typename Alloc>
fixed_vector<T,Alloc>::fixed_vector (fixed_vector const &V) // strong_throw
: m_p ( alloc(V.m_sz) ), m_sz(V.m_sz) {
    size_type i;
    i= 0;
    try {
        using namespace std;
        uninitialized_copy(V.begin(), V.end(), this->begin());
    } catch(...) {

        delete[] m_p; m_p= nullptr;
        throw; // rethrow
    }// ~catch
}


// Constructor cantidad (N)
template <typename T, typename Alloc>
fixed_vector<T,Alloc>::fixed_vector (size_type N) // strong_throw
: m_sz(N), m_p ( alloc(N) ) {
    try {
................................................................................
    p.m_sz= 0;
}


// Destructor
template <typename T, typename Alloc>
fixed_vector<T,Alloc>::~fixed_vector () {
    if (m_p==nullptr && m_sz==0)  return; // empty, nothing to do
    using namespace std;
    typedef typename conditional < std::is_const<T>::value ,
        char const*,
        char*>
    ::type buffertype;
    for (size_type i=0; i < m_sz; ++i) {
        (m_p+i)->~T();
    }
    delete[] reinterpret_cast<buffertype>(m_p);
    m_p= nullptr;
}

template <typename T, typename Alloc>
fixed_vector<T,Alloc>& fixed_vector<T,Alloc>::operator= (fixed_vector<T,Alloc> rhs) {
    return this->assign(rhs);
}








|

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

>

<
>
>







 







|


|







>







 







|


<
<
<
<




|






>








<
<
<
<
<
<
<
<
<

<
<
<
<







 







|

|
|
<
<
<
<
<
<
<







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
...
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
...
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
...
339
340
341
342
343
344
345
346
347
348
349







350
351
352
353
354
355
356
    typedef std::reverse_iterator<iterator> reverse_iterator;  //!< reverse @c iterator type.
    typedef std::reverse_iterator<const_iterator> const_reverse_iterator; //!< reverse @c const_iterator type.

    public:

	//! Default constructor. Sets up an empty (unusable) fixed-vector.
    fixed_vector ()
	: m_sz(0), m_p(nullptr)
	{}

    fixed_vector (fixed_vector const &V)
    : m_sz(V.m_sz), m_p(nullptr) {
		using namespace std;
		T* m_end;
		try {
			m_p= alloc(m_sz);
			m_end= uninitialized_copy(V.begin(), V.end(), this->begin());
		} catch(...) {
			destroy(m_p, m_end);
			delete[] m_p; m_p= nullptr;
			m_sz= 0;
			throw; // rethrow
		} // ~catch
	}

    explicit fixed_vector (size_type N);     //!< (1) count-constructor

    fixed_vector (size_type N, T const& v);  //!< (3) count-constructor



    //! iterator-constructor
    template <typename It>
    fixed_vector (It ini, It fin, typename std::enable_if<is_iterator<It>::value,bool>::type* = nullptr);

#if (CXXOMFORT_CXX_STD >= 2011) || defined(DOXYGEN_DOC)
	/** 
	 * (7) initializer_list-ctor
................................................................................
    // Information
    ////////
    
	//! Maximum allowed size (as per allocator).
    CXXO_CONSTEXPR 
    size_type       max_size () const CXXO_NOEXCEPTNOTHROW { return m_sz; } 
    //! Current ( = maxium) size.
    CXXO_CONSTEXPR 
    size_type       size () const CXXO_NOEXCEPTNOTHROW { return m_sz; }
    //! Check if container is empty ( = has @c size == 0).
    CXXO_CONSTEXPR 
    bool            empty () const CXXO_NOEXCEPTNOTHROW { return m_p == nullptr && m_sz == 0; } 
	//! Access to the data pointer.
    const T*        data () const CXXO_NOEXCEPTNOTHROW { return m_p; }
    //! Access to the data pointer.
    T*              data () CXXO_NOEXCEPTNOTHROW { return m_p; }

    //! Unchecked (!) direct access to elements
    CXXO_CONSTEXPR 
    const_reference operator[] (size_type idx) const CXXO_NOEXCEPTNOTHROW {
        return m_p[idx];
    }
    //! @overload operator[]
    reference operator[] (size_type idx) CXXO_NOEXCEPTNOTHROW {
        return m_p[idx];
    }
................................................................................
        for (iterator i= this->begin(); i != this->end(); ++i) {*i= v;}
    }

    //! swap with another @c fixed_vector 
    void swap (fixed_vector<T,Alloc> & rhs) {
        std::swap(this->m_p, rhs.m_p);
        std::swap(this->m_sz, rhs.m_sz);
        std::swap(this->m_a, rhs.m_a);
    }






    private:
    size_type m_sz;
    T* m_p;
    Alloc m_a;

    T* alloc (size_type n) {
        return reinterpret_cast<T*>( new char [n * sizeof(T)] );
    }
    
    void release (size_type n) {
		// is simply ignoring new char[...] safe to do?
        (void)n;
    }

};

//
// copy constructor
//
















// Constructor cantidad (N)
template <typename T, typename Alloc>
fixed_vector<T,Alloc>::fixed_vector (size_type N) // strong_throw
: m_sz(N), m_p ( alloc(N) ) {
    try {
................................................................................
    p.m_sz= 0;
}


// Destructor
template <typename T, typename Alloc>
fixed_vector<T,Alloc>::~fixed_vector () {
    if (this->empty())  return; // empty, nothing to do
    using namespace std;
    destroy_n(m_p, m_sz);
    release(m_sz);







}

template <typename T, typename Alloc>
fixed_vector<T,Alloc>& fixed_vector<T,Alloc>::operator= (fixed_vector<T,Alloc> rhs) {
    return this->assign(rhs);
}

Changes to cxxomfort/cxxomfort/library/foreach.hpp.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
38
39
40
41
42
43
44
45
46
47
48
49
50





51
52
53
54
55
56
57
 */

#include <cxxomfort/base.hpp> 

#if (CXXO_COMPILER_SUPPORT_foreach > 0)
    // C++11 onwards, plus some compilers with c++0x support
    #define CXXOMFORT_IMPLEMENTS_n2930 CXXO_IMPLSTATUS_NATIVE()

    #define CXXOMFORT_IMPLEMENTS_foreach CXXOMFORT_IMPLEMENTS_n2930

    #define CXXO_FOREACH(VDecl,CDecl) for (VDecl : CDecl)

#else
    #define CXXOMFORT_USING_FOREACH_EMULATION 1
    #define CXXOMFORT_IMPLEMENTS_n2930 CXXO_IMPLSTATUS_EMULATION()
    #define CXXOMFORT_IMPLEMENTS_foreach CXXOMFORT_IMPLEMENTS_n2930


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

/*
 * For any other compiler, we use Artima article's basic solution
 * up to Page 2, that is, support for evaluating the container
................................................................................
 * container expression once.
 * - support from iterator.hpp to use global begin(), end(),
 * which allows it to trivially support eg.: C arrays and strings.
 *
 */


    #if defined(__GNUC__)
        #include "../impl/foreach_gcc.hpp"
    #else
        #include "../impl/foreach_artima.hpp"
    #endif






#endif // c++ mode

#if defined(DOXYGEN_DOC)
/**
 * @def CXXO_FOREACH(itemdecl,collection)
 * @brief Foreach loop construct that iterates over @p collection .
 * @ingroup cxxo-sup







>





<
<
<
<
<







 







|





>
>
>
>
>







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





19
20
21
22
23
24
25
..
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
 */

#include <cxxomfort/base.hpp> 

#if (CXXO_COMPILER_SUPPORT_foreach > 0)
    // C++11 onwards, plus some compilers with c++0x support
    #define CXXOMFORT_IMPLEMENTS_n2930 CXXO_IMPLSTATUS_NATIVE()
    #undef  CXXOMFORT_IMPLEMENTS_foreach
    #define CXXOMFORT_IMPLEMENTS_foreach CXXOMFORT_IMPLEMENTS_n2930

    #define CXXO_FOREACH(VDecl,CDecl) for (VDecl : CDecl)

#else





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

/*
 * For any other compiler, we use Artima article's basic solution
 * up to Page 2, that is, support for evaluating the container
................................................................................
 * container expression once.
 * - support from iterator.hpp to use global begin(), end(),
 * which allows it to trivially support eg.: C arrays and strings.
 *
 */


    #if CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG || CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC
        #include "../impl/foreach_gcc.hpp"
    #else
        #include "../impl/foreach_artima.hpp"
    #endif

    #define CXXOMFORT_USING_FOREACH_EMULATION 1
    #define CXXOMFORT_IMPLEMENTS_n2930 CXXO_IMPLSTATUS_EMULATION()
    #undef  CXXOMFORT_IMPLEMENTS_foreach
    #define CXXOMFORT_IMPLEMENTS_foreach CXXOMFORT_IMPLEMENTS_n2930

#endif // c++ mode

#if defined(DOXYGEN_DOC)
/**
 * @def CXXO_FOREACH(itemdecl,collection)
 * @brief Foreach loop construct that iterates over @p collection .
 * @ingroup cxxo-sup

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

9
10
11
12
13
14
15












16
17
18
19
20
21
22
..
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
...
179
180
181
182
183
184
185

186
187
188
189
190
191
192
#include <utility>
/**
 * @file 
 * @ingroup cxxo-sup-functional
 * 
 * */













#if (CXXOMFORT_CXX_STD>=1997 || defined(DOXYGEN_DOC))

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

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

................................................................................
 * "Overload" for @c std::ptr_fun that wrapps nullary functions.
 * */
template <typename R>
nullary_function_ptrt<R> ptr_fun (R(* const function)()) {
    return nullary_function_ptrt<R>(function);
}

//! Generic no-op functor, for wrapping "unset" eg.: @c function , @c function_ref .
struct noop_t {
    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(); }
};

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


} // .functional:
}}

#include "operatorit.hpp" // supplement operator functors


#include "../impl/p0792r0-function_ref.hpp"

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

#else // < 1997







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







 







<
<
<
<
<
<
<
<
<
<
<







 







>







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
..
54
55
56
57
58
59
60











61
62
63
64
65
66
67
...
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#include <utility>
/**
 * @file 
 * @ingroup cxxo-sup-functional
 * 
 * */

// 
// noop functor and function
// 
#include <cxxomfort/cxxo-utils.hpp> // noop_fn

namespace cxxomfort { namespace library {
namespace functional {

using cxxomfort::noop;

} } } 

#if (CXXOMFORT_CXX_STD>=1997 || defined(DOXYGEN_DOC))

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

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

................................................................................
 * "Overload" for @c std::ptr_fun that wrapps nullary functions.
 * */
template <typename R>
nullary_function_ptrt<R> ptr_fun (R(* const function)()) {
    return nullary_function_ptrt<R>(function);
}













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

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


} // .functional:
}}

#include "operatorit.hpp" // supplement operator functors

//! @include{doc} "../impl/p0792r0-function_ref.hpp"
#include "../impl/p0792r0-function_ref.hpp"

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

#else // < 1997

Changes to cxxomfort/cxxomfort/library/iterator.hpp.

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
...
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
...
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
#define CXXOMFORT_SUPP_ITERATOR_HPP
#include <cxxomfort/config.hpp>
#include <cxxomfort/base.hpp>
#include <iterator>
#include <functional>
#include <cxxomfort/iterator.hpp>
#include <cxxomfort/functional.hpp>
//#include <cxxomfort/impl/n3334-array_ref.hpp>
#include <cxxomfort/impl/p1227r0-ssize.hpp> // ssize


/**
 * @file
 * @ingroup cxxo-sup-iterator
 */

namespace cxxomfort { namespace library { 
namespace iterator {

using ::cxxomfort::impl::ssize;

template <typename Integer, typename I>
size_t absdistance (I i1, I i2, Integer i, std::forward_iterator_tag) {
    for (i= 0; i1 != i2; ++i, ++i1) {}
    return i; 
}

template <typename Integer, typename I>
................................................................................
	{}

	CXXO_CONSTEXPR 
	size_type size () const CXXO_NOEXCEPTNOTHROW {
		return c.size();
	}
	
	CXXO_CONSTEXPR 
	iterator begin () {
		return c.begin();
	}

	CXXO_CONSTEXPR 
	iterator end () {
		return c.end();
	}
	
	value_type const& 
	at_or (size_type i, value_type const& o) const CXXO_NOEXCEPTNOTHROW {
		return i < c.size() ? c[i] : o;
................................................................................
 * 
 * namespace iterator2 = cxxomfort::library::iterator;
 * 
 * @endcode
 * 
 * This component provides supplementary features for 
 * the utilities found in <tt><iterator></tt>.


 * 
 * Interfaces defined here:
 * 
 * * @c absdistance() .
 * * @c ssize() from p1227r0. (to be moved to std)
 * * @c fake_iterator and @c make_fake_iterator() .
 * * @c function_iterator and @c make_function_iterator() .
 * * @c container_extensions_view .
 * 
 * All interfaces are defined in the namespace 
 * <tt>cxxomfort::library::iterator::</tt>.
 * 
 * @see





 * * @ref std0iterator

 * 
 */

#endif







<











<
<







 







<




<







 







>
>




<







|
>
>
>
>
>
|
>




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
...
148
149
150
151
152
153
154

155
156
157
158

159
160
161
162
163
164
165
...
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
#define CXXOMFORT_SUPP_ITERATOR_HPP
#include <cxxomfort/config.hpp>
#include <cxxomfort/base.hpp>
#include <iterator>
#include <functional>
#include <cxxomfort/iterator.hpp>
#include <cxxomfort/functional.hpp>

#include <cxxomfort/impl/p1227r0-ssize.hpp> // ssize


/**
 * @file
 * @ingroup cxxo-sup-iterator
 */

namespace cxxomfort { namespace library { 
namespace iterator {



template <typename Integer, typename I>
size_t absdistance (I i1, I i2, Integer i, std::forward_iterator_tag) {
    for (i= 0; i1 != i2; ++i, ++i1) {}
    return i; 
}

template <typename Integer, typename I>
................................................................................
	{}

	CXXO_CONSTEXPR 
	size_type size () const CXXO_NOEXCEPTNOTHROW {
		return c.size();
	}
	

	iterator begin () {
		return c.begin();
	}


	iterator end () {
		return c.end();
	}
	
	value_type const& 
	at_or (size_type i, value_type const& o) const CXXO_NOEXCEPTNOTHROW {
		return i < c.size() ? c[i] : o;
................................................................................
 * 
 * namespace iterator2 = cxxomfort::library::iterator;
 * 
 * @endcode
 * 
 * This component provides supplementary features for 
 * the utilities found in <tt><iterator></tt>.
 * 
 * @section Interfaces
 * 
 * Interfaces defined here:
 * 
 * * @c absdistance() .

 * * @c fake_iterator and @c make_fake_iterator() .
 * * @c function_iterator and @c make_function_iterator() .
 * * @c container_extensions_view .
 * 
 * All interfaces are defined in the namespace 
 * <tt>cxxomfort::library::iterator::</tt>.
 * 
 * Interfaces previously defined here:
 * 
 * * @c ssize() from p1227r0, moved to @ref std0iterator .
 * 
 * @section also See Also
 * 
 * * @see @ref std0iterator
 * * @see @ref cxxo-sup-algorithm 
 * 
 */

#endif

Changes to cxxomfort/cxxomfort/library/random.hpp.

115
116
117
118
119
120
121
122
123



124




125
126
127
128
129
130
131

class splitmix64 {
    // we'll mirror the interface of eg.: minstd_rand somewhat
    private:
    uint64_t _state;
    public:
    typedef uint64_t result_type;
    
    static CXXO_CONSTEXPR14 const result_type min = 0;



    static CXXO_CONSTEXPR14 const result_type max = cxxomfort::fix::integral_limits<uint64_t>::const_max;




    
    CXXO_CONSTEXPR splitmix64 (uint64_t seed) CXXO_NOEXCEPTNOTHROW 
    : _state(seed)  {}
    
    void seed (uint64_t s) CXXO_NOEXCEPTNOTHROW {
        _state= s;
    }







|
|
>
>
>
|
>
>
>
>







115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

class splitmix64 {
    // we'll mirror the interface of eg.: minstd_rand somewhat
    private:
    uint64_t _state;
    public:
    typedef uint64_t result_type;
 
    static CXXO_CONSTEXPR14 result_type min () CXXO_NOEXCEPTNOTHROW { 
		return 0;
	}
    static CXXO_CONSTEXPR14 result_type max () CXXO_NOEXCEPTNOTHROW {
		return cxxomfort::fix::integral_limits<uint64_t>::const_max;
	}
	
	//static const result_type const_min = min();
	//static const result_type const_max = max();
    
    CXXO_CONSTEXPR splitmix64 (uint64_t seed) CXXO_NOEXCEPTNOTHROW 
    : _state(seed)  {}
    
    void seed (uint64_t s) CXXO_NOEXCEPTNOTHROW {
        _state= s;
    }

Changes to cxxomfort/cxxomfort/library/utility.hpp.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#include <cxxomfort/impl/relationals.hpp>


namespace cxxomfort { namespace library { 
namespace utility {


template <unsigned I>
struct prio 
: prio <I-1> {};

template <>
struct prio<0> {};

// 
// non-const 
// 

template <typename T>
T& as_nonconst (T& p) {
	return p;







<
<
<
<
<
<
<
<







15
16
17
18
19
20
21








22
23
24
25
26
27
28

#include <cxxomfort/impl/relationals.hpp>


namespace cxxomfort { namespace library { 
namespace utility {









// 
// non-const 
// 

template <typename T>
T& as_nonconst (T& p) {
	return p;

Changes to cxxomfort/cxxomfort/limits.hpp.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * * cxxomfort::integral_limits
 *
 */

#include "./config.hpp"
#include "./base.hpp"
#include "./type_traits.hpp"
#include "./util/meta.hpp"
#include <limits>
//#include <type_traits>
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <limits> support.")
#endif









<







9
10
11
12
13
14
15

16
17
18
19
20
21
22
 * * cxxomfort::integral_limits
 *
 */

#include "./config.hpp"
#include "./base.hpp"
#include "./type_traits.hpp"

#include <limits>
//#include <type_traits>
#if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
#pragma message CXXO_NOTICE("enabled <limits> support.")
#endif


Changes to cxxomfort/cxxomfort/memory.hpp.

21
22
23
24
25
26
27






















28
29
30
31
32
33
34
..
41
42
43
44
45
46
47
48
49
50



51
52
53
54
55
56
57
...
143
144
145
146
147
148
149


150
151


152
153


154
155
156
157
158
159
160
...
373
374
375
376
377
378
379
380
381
382
383
384
385
386

387
388
389
390
391
392
393
#if (CXXOMFORT_CXX_STD < 2011 && CXXOFLAG_namespace_tr1>0)
	#if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC || CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG)
		#include <tr1/memory>
		#include <tr1/functional> // for hash
namespace std {
	using tr1::shared_ptr;
	using tr1::weak_ptr;























	template <typename T>
	shared_ptr<T> make_shared () {
		return shared_ptr<T>( new T() );
	}

	template <typename T, typename A1>
................................................................................
		return shared_ptr<T>( new T(a1,a2) );
	}

	template <typename T, typename A1, typename A2, typename A3>
	shared_ptr<T> make_shared (A1 const& a1, A2 const& a2, A3 const& a3) {
		return shared_ptr<T>( new T(a1,a2,a3) );
	}

}
	#endif



#endif

#include "impl/11-conditional.hpp"
#include <cxxomfort/type_traits.hpp> // is_convertible

//
// addressof
................................................................................


//
// 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
//

#include "impl/14-make_unique.hpp"
................................................................................
 * * @c alignof() (C++11) (See @e base_features ).
 * * @c addressof() (C++11) - get the memory address of an object.
 * * Pointer traits and Allocator traits (C++11) - tools for assisting in the design of containers.
 * * @link cxxomfort::cxxostd::aligned_storage @c aligned_storage @endlink </code> (C++11) - create an unitialized buffer for storing an object of a given type.
 * * @link cxxomfort::cxxostd::unique_ptr @c unique_ptr emulation @endlink (C++11) - smart pointer that owns and holds a resource.
 * * @c @ref make_unique() (C++14) - assist for creating @c unique_ptr .
 * * @c destroy() , @c destroy_at() (C++17) - memory management by calling destructors.
 * * @c make_shared() - construct shared smart pointers safely.
 *
 * Interfaces repointed here when found in TR1:
 * 
 * * @c std::shared_ptr  and related utilities.
 * * @c std::weak_ptr  and related utilities.
 * * @c std::default_deleter

 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 *
 * * <tt>to_bool()</tt> overloads to quickly check validity of a smart pointer:
 *   * <tt>to_bool(std::shared_ptr const&)</tt>
 *   * <tt>to_bool(std::unique_ptr const&)</tt>
 * * <tt>#cxxomfort::fix::malloc_deleter</tt> - function object that wrapps @c free() .







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







 








|
<
>
>
>







 







>
>


>
>


>
>







 







|






>







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
..
63
64
65
66
67
68
69
70
71

72
73
74
75
76
77
78
79
80
81
...
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
...
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
#if (CXXOMFORT_CXX_STD < 2011 && CXXOFLAG_namespace_tr1>0)
	#if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC || CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG)
		#include <tr1/memory>
		#include <tr1/functional> // for hash
namespace std {
	using tr1::shared_ptr;
	using tr1::weak_ptr;

	#define CXXOMFORT_USING_make_shared
	
}

	#elif (CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, < 1600) )
		#define CXXOMFORT_USING_make_shared

namespace std {
	using tr1::shared_ptr;
	using tr1::weak_ptr;
}

	#endif
#endif

// 
// make_shared 
// 
#ifdef CXXOMFORT_USING_make_shared

namespace std {

	template <typename T>
	shared_ptr<T> make_shared () {
		return shared_ptr<T>( new T() );
	}

	template <typename T, typename A1>
................................................................................
		return shared_ptr<T>( new T(a1,a2) );
	}

	template <typename T, typename A1, typename A2, typename A3>
	shared_ptr<T> make_shared (A1 const& a1, A2 const& a2, A3 const& a3) {
		return shared_ptr<T>( new T(a1,a2,a3) );
	}




}

#endif

#include "impl/11-conditional.hpp"
#include <cxxomfort/type_traits.hpp> // is_convertible

//
// addressof
................................................................................


//
// unique_ptr
//

#if (CXXOMFORT_CXX_STD>=2011)
	#undef  CXXOMFORT_IMPLEMENTS_unique_ptr
	#define CXXOMFORT_IMPLEMENTS_unique_ptr CXXO_IMPLSTATUS_NATIVE()
#elif (CXXOMFORT_CXX_STD>=1997)
	#include "impl/unique_ptr.hpp"
	#undef  CXXOMFORT_IMPLEMENTS_unique_ptr
	#define CXXOMFORT_IMPLEMENTS_unique_ptr CXXO_IMPLSTATUS_EMULATION()
#else
	#include "impl/unique_ptr-poor.hpp"
	#define CXXOMFORT_IMPLEMENTS_unique_ptr 0

#endif

//
// make_unique
//

#include "impl/14-make_unique.hpp"
................................................................................
 * * @c alignof() (C++11) (See @e base_features ).
 * * @c addressof() (C++11) - get the memory address of an object.
 * * Pointer traits and Allocator traits (C++11) - tools for assisting in the design of containers.
 * * @link cxxomfort::cxxostd::aligned_storage @c aligned_storage @endlink </code> (C++11) - create an unitialized buffer for storing an object of a given type.
 * * @link cxxomfort::cxxostd::unique_ptr @c unique_ptr emulation @endlink (C++11) - smart pointer that owns and holds a resource.
 * * @c @ref make_unique() (C++14) - assist for creating @c unique_ptr .
 * * @c destroy() , @c destroy_at() (C++17) - memory management by calling destructors.
 * * @c make_shared() - construct shared smart pointers safely, for C++03.
 *
 * Interfaces repointed here when found in TR1:
 * 
 * * @c std::shared_ptr  and related utilities.
 * * @c std::weak_ptr  and related utilities.
 * * @c std::default_deleter
 * * @c std::make_shared .
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 *
 * * <tt>to_bool()</tt> overloads to quickly check validity of a smart pointer:
 *   * <tt>to_bool(std::shared_ptr const&)</tt>
 *   * <tt>to_bool(std::unique_ptr const&)</tt>
 * * <tt>#cxxomfort::fix::malloc_deleter</tt> - function object that wrapps @c free() .

Changes to cxxomfort/cxxomfort/numeric.hpp.

1
2
3
4
5

6
7
8
9
10
11
12
13
14
15
16
17
18
..
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
...
125
126
127
128
129
130
131



132
133
134
135
136

137

































138
139
140
141
142
143
#ifndef CXXOMFORT_NUMERIC_HPP
#define CXXOMFORT_NUMERIC_HPP
/**
 * @file
 * @brief Implementations and backports tied to <tt><numeric></tt>.

 * 
 */


#include "base.hpp"
#include "util/meta.hpp" // conditional
#include <numeric>


namespace cxxomfort {
namespace cxxostd {

/**
................................................................................

// 
// midpoint, from C++20
// 

#if (CXXOMFORT_CXX_STD < 2020)
	#define CXXOMFORT_USING_midpoint







template <typename Numeric>

CXXO_CONSTEXPR Numeric midpoint (Numeric n1, Numeric n2) CXXO_NOEXCEPTNOTHROW {
	return n1/Numeric(2) + n2/Numeric(2);
}









template <typename T>

CXXO_CONSTEXPR T* midpoint (T* p1, T* p2) CXXO_NOEXCEPTNOTHROW {
	return p1+(p2-p1)/2;
}
#else

using std::midpoint;

#endif




	























































} } // cxxomfort::cxxostd


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

................................................................................
 * @brief Backports related to Standard header <tt><numeric></tt> 
 * 
 * @code
 * #include <cxxomfort/numeric.hpp>
 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)



 * Interfaces defined in this section:
 * 
 * * @c iota() (C++11) -  generate sequences of increasing values.
 * * @c gcd() , @c lcm() (C++17) - math functions.
 * * @c midpoint() (C++20) - midpoint of integers, floating points or pointers.

 * 

































 * @subsection also See Also
 * 
 * * @see @cppref{header/numeric} (cppreference)
 * * @see @ref std0algorithm
 * * @ref cxxo-sup-numeric (supplemental).
 */




|
>





<







 







>
>
>
>
>
>
>

>
|




>
>
>
>
>
>
>

>
|








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







 







>
>
>



|

>

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


|


1
2
3
4
5
6
7
8
9
10
11

12
13
14
15
16
17
18
..
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
...
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
#ifndef CXXOMFORT_NUMERIC_HPP
#define CXXOMFORT_NUMERIC_HPP
/**
 * @file
 * @brief Implementations and backports tied to <tt>\<numeric\></tt>.
 * @xrefitem std0numeric "<numeric>" "Header"
 * 
 */


#include "base.hpp"

#include <numeric>


namespace cxxomfort {
namespace cxxostd {

/**
................................................................................

// 
// midpoint, from C++20
// 

#if (CXXOMFORT_CXX_STD < 2020)
	#define CXXOMFORT_USING_midpoint
/**
 * @brief Returns the midpoint between two numeric values, avoiding overflows.
 * @return <tt>(n1 + n2)/2</tt>, avoiding overflows.
 * @ingroup cxx20-backports 
 * @see @wg21{P0811R3}
 * 
 * */
template <typename Numeric>
inline CXXO_CONSTEXPR 
Numeric midpoint (Numeric n1, Numeric n2) CXXO_NOEXCEPTNOTHROW {
	return n1/Numeric(2) + n2/Numeric(2);
}


/**
 * @brief Returns the midpoint between two pointers.
 * @return A pointer @a p half the distance away from @a p1 in the direction towards @a p2 .
 * @ingroup cxx20-backports 
 * @see @wg21{P0811R3}
 * 
 * */
template <typename T>
inline CXXO_CONSTEXPR 
T* midpoint (T* p1, T* p2) CXXO_NOEXCEPTNOTHROW {
	return p1+(p2-p1)/2;
}
#else

using std::midpoint;

#endif

// 
// p0616 - move- versions of numeric algorithms
// 

namespace cxx20 {

template <typename II, typename Ty>
inline CXXO_CONSTEXPR14 
Ty accumulate (II ini, II fin, Ty i0){
	for (; ini != fin; ++ini) {
		i0 = std::move(i0) + *ini;
	}
	return i0;
}

template <typename II, typename Ty, typename Binary>
inline CXXO_CONSTEXPR14 
Ty accumulate (II ini, II fin, Ty i0, Binary op) {
	for (; ini != fin; ++ini) {
		i0 = op(std::move(i0), *ini);
	}
	return i0;
}

template <typename II1, typename II2, typename T>
inline CXXO_CONSTEXPR14 
T inner_product (II1 ini1, II1 fin1, II2 ini2, T i0) {
	for (; ini1 != fin1; ++ini1, ++ini2) {
		i0= std::move(i0) + *ini1 * *ini2;
	}
	return i0;
}

template <typename II1, typename II2, typename T, typename Binary1, typename Binary2>
inline CXXO_CONSTEXPR14 
T inner_product (II1 ini1, II1 fin1, II2 ini2, T i0, Binary1 sum, Binary2 product) {
	for (; ini1 != fin1; ++ini1, ++ini2) {
		i0= sum(std::move(i0) , product(*ini1 , *ini2) );
	}
	return i0;
}


} // namespace

// accessible synonyms

template <typename II, typename Ty>
inline CXXO_CONSTEXPR14 
Ty move_accumulate (II ini, II fin, Ty i0) {
	return cxx20::accumulate(ini,fin,i0);
}

template <typename II, typename Ty, typename Binary>
inline CXXO_CONSTEXPR14 
Ty move_accumulate (II ini, II fin, Ty i0, Binary f) {
	return cxx20::accumulate(ini,fin,i0,f);
}

} } // cxxomfort::cxxostd


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

................................................................................
 * @brief Backports related to Standard header <tt><numeric></tt> 
 * 
 * @code
 * #include <cxxomfort/numeric.hpp>
 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)
 * 
 * @section Interfaces
 * 
 * Interfaces defined in this section:
 * 
 * * @c iota() (C++11) -  generate sequences of increasing values.
 * * @c gcd() , @c lcm() (C++17) - math functions for greatest common divisor.
 * * @c midpoint() (C++20) - midpoint of integers, floating points or pointers.
 * * Numeric algorithms @c accumulate() and @c inner_product() with <tt>std::move()</tt> versions as per C++20, under namespace <tt>cxxomfort::cxxostd::cxx20</tt>.
 * 
 * Implementation fixes:
 * 
 * * (none)
 * 
 * @section move-numerics Numeric Algorithms with std::move (c++20)
 * 
 * Proposal @e p0616r0 introduces modifications to the algorithms under <tt><numeric></tt> so that they invoke <tt>std::move()</tt> on the accumulated cursor. The proposal indicates that this was first intended for C++11 but never proposed because of a lack of "bravery" as it was thought back then that this would introduce a breaking change.
 * 
 * Essentially, the new versions of these algorithms change the underlying operation loop as follows:
 * 
 * @code
 * 
 * // before p0616:
 * accumulate (ini, fin, v0) ;
 * { // loop body
 * v0 = v0 + *ini;
 * }
 * // after p0616:
 * accumulate (ini, fin, v0) ;
 * { // loop body
 * v0 = std::move(v0) + *ini;
 * }
 * 
 * @endcode
 * 
 * Because cxxomfort can not overwrite already existing functions, an opt-in shadowing mechanism is offered instead with the new functions being offered under sub-namespace <tt>cxx20</tt>:
 * 
 * @code
 * using namespace std; // std::accumulate
 * using cxxomfort::cxxostd::cxx20::accumulate;
 * @endcode
 * 
 * 
 * @section also See Also
 * 
 * * @see @cppref{header/numeric} (cppreference)
 * * @see @ref std0algorithm (std generic algorithms)
 * * @ref cxxo-sup-numeric (supplemental).
 */

Changes to cxxomfort/cxxomfort/ostream.hpp.

4
5
6
7
8
9
10
11

12
13

14



















15
16
17
18
19
20
21
..
60
61
62
63
64
65
66






67
68
69
70
71
72

73
74
75
76
77
78
79
 * @file cxxomfort/ostream.hpp
 * @brief Implementations, Backports and helpers for Standard header <code>\<ostream\></code>.
 * @xrefitem std0ostream "<ostream>" "Header"
 * 
 * 
 */

#include "base.hpp"

#include CXXO_INCLUDE_SYS(ostream)























/*
 * Outputs the given string_view to a C++ output stream.
 * */
#include <cxxomfort/string_view.hpp>

#if (CXXOMFORT_CXX_STD>=2017)
................................................................................
 * 
 * @code
 * #include <cxxomfort/ostream.hpp>
 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)
 *






 * Interfaces defined in this section:
 * 
 * * <tt>operator<< (ostream&, T const&)</tt> for the following types T: 
 *   * <tt>unique_ptr<T></tt>
 *   * <tt>shared_ptr<T></tt>
 *   * <tt>std::byte</tt>

 * 
 *
 * @section also See Also
 * 
 * @see @cppref{header/ostream} (cppreference)
 * 
 * */







|
>


>

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







 







>
>
>
>
>
>


|


|
>







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
..
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
 * @file cxxomfort/ostream.hpp
 * @brief Implementations, Backports and helpers for Standard header <code>\<ostream\></code>.
 * @xrefitem std0ostream "<ostream>" "Header"
 * 
 * 
 */

#include <cxxomfort/base.hpp>
#include <cxxomfort/cxxo-utils.hpp>
#include CXXO_INCLUDE_SYS(ostream)

namespace cxxomfort {

/*
 * Outputs a tiny[u]int 
 * */

std::ostream& operator<< (std::ostream& os, tinyint const x) CXXO_NOEXCEPTNOTHROW {
	return os<< to_integral<signed int>(x);
}
std::ostream& operator<< (std::ostream& os, tinyuint const x) CXXO_NOEXCEPTNOTHROW {
	return os<< to_integral<unsigned int>(x);
}

/*
 * Outputs a rvoid 
 * */
std::ostream& operator<< (std::ostream& os, rvoid const) CXXO_NOEXCEPTNOTHROW {
	return os;
}

} // cxxomfort::

/*
 * Outputs the given string_view to a C++ output stream.
 * */
#include <cxxomfort/string_view.hpp>

#if (CXXOMFORT_CXX_STD>=2017)
................................................................................
 * 
 * @code
 * #include <cxxomfort/ostream.hpp>
 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)
 *
 * @section Interfaces
 * 
 * This section does not (for now) implement features of its own; rather, it provides 
 * functionality for other sections that is separated from their implementation sections 
 * so as to avoid a direct dependency on C++ IOstreams when it is not needed.
 * 
 * Interfaces defined in this section:
 * 
 * * <tt>operator<< (ostream&, T const&)</tt> for the following types: 
 *   * <tt>unique_ptr<T></tt>
 *   * <tt>shared_ptr<T></tt>
 *   * @link stdbyte <tt>std::byte</tt> @endlink
 *   * @link cxxomfort::cxxostd::basic_string_view <tt>std::basic_string_view<U></tt> @endlink eg.: <tt>string_view</tt>
 * 
 *
 * @section also See Also
 * 
 * @see @cppref{header/ostream} (cppreference)
 * 
 * */

Changes to cxxomfort/cxxomfort/random.hpp.

67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
...
122
123
124
125
126
127
128

129
130
131
132
133
134
135
136
137
138
...
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
// #include "impl/11-random_device.hpp"

namespace cxxomfort { namespace cxxostd {

/**
 * @brief An adapter that caches and returns results from a generator in a random-ish order.
 * @ingroup cxx11-backports
 * @xrefitem std0random "" ""
 * @anchor shuffle_order_engine
 * 
 * Given an @a Engine such as @c ranlux24_base , the instantiation 
 * <code>Foo : shuffle_order_engine<ranlux24_base,44></code> creates an 
 * adaptor that acts as an Engine, except that it caches @a 44 values 
 * that are then returned randomly instead of in the order given by the 
 * generator. Each new invocation of <code>::operator()</code> replaces 
................................................................................
    private:
    std::array<typename Engine::result_type, K> cache_;
    Engine engine_;

};

/**

 * @c knuth_b as per C++11.
 * @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".
................................................................................

/**
 * @page std0random <random>
 * @brief Backports related to Standard Header <tt><random></tt>
 * 
 * @code
 * #include <cxxomfort/random.hpp>


 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)
 * Interfaces defined in this section:
 * 
 * Including the header brings up <random>'s features, accounting for eg.: 
 * location being @c std::tr1::random... where set up in C++03, 
 * as well as its names back then varying according to the compiler.



 * 
 * Interfaces defined in this section:
 * 
 * * @link cxxomfort::cxxostd::default_random_engine @c default_random_engine @endlink - in cxxomfort defined as ranlux24_base for C++03.
 * 
 * Interfaces repointed here:
 * 
 * * @c linear_congruent_engine , @c minstd , @c minstd0 , when they are brought with different name.
 * 
 * Fixes / non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * <tt>randmo()</tt> - modulo-respecting call to <tt>rand()</tt>.
 * * <tt>cxxomfort::fix::shuffle_order_engine</tt> - for broken std in MSVC 2010.
 * * @c cxxomfort::fix::knuth_b - for broken std in MSVC 2010.
 *
 * Pending:
 * 
 * * @c generate_canonical complementary (C++11).
 * * @c uniform_int_distribution complementary (C++11).
 * * @c discrete_distribution complementary (C++11).
 *



 * See also: @ref cxxo-sup-random (supplemental), 
 * <a href="https://en.cppreference.com/w/cpp/header/random">\<random\> \@cppreference</a>.
 * 
 * */







|







 







>


|







 







>
>


<
<
<


<
>
>
>







|



|









>
>
>
|
<


67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
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
// #include "impl/11-random_device.hpp"

namespace cxxomfort { namespace cxxostd {

/**
 * @brief An adapter that caches and returns results from a generator in a random-ish order.
 * @ingroup cxx11-backports
 * @xrefitem std0random "<random>" "Engnies"
 * @anchor shuffle_order_engine
 * 
 * Given an @a Engine such as @c ranlux24_base , the instantiation 
 * <code>Foo : shuffle_order_engine<ranlux24_base,44></code> creates an 
 * adaptor that acts as an Engine, except that it caches @a 44 values 
 * that are then returned randomly instead of in the order given by the 
 * generator. Each new invocation of <code>::operator()</code> replaces 
................................................................................
    private:
    std::array<typename Engine::result_type, K> cache_;
    Engine engine_;

};

/**
 * @brief Specialization of shuffle order engine named after Donald Knuth.
 * @c knuth_b as per C++11.
 * @ingroup cxx11-backports
 * @xrefitem std0random "<random>" "Engines"
 * @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".
................................................................................

/**
 * @page std0random <random>
 * @brief Backports related to Standard Header <tt><random></tt>
 * 
 * @code
 * #include <cxxomfort/random.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 



 * Including the header brings up <random>'s features, accounting for eg.: 
 * location being @c std::tr1::random... where set up in C++03, 

 * as well as changes to their names in certain compiler versions before C++11 was finalized.
 * 
 * @section Interfaces
 * 
 * Interfaces defined in this section:
 * 
 * * @link cxxomfort::cxxostd::default_random_engine @c default_random_engine @endlink - in cxxomfort defined as ranlux24_base for C++03.
 * 
 * Interfaces repointed here:
 * 
 * * @c linear_congruent_engine and its named typedefs @c minstd , @c minstd0 , when they are brought with different name.
 * 
 * Fixes / non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * @link cxxomfort::fix::randmo() <tt>randmo()</tt> @endlink - modulo-respecting call to <tt>rand()</tt>.
 * * <tt>cxxomfort::fix::shuffle_order_engine</tt> - for broken std in MSVC 2010.
 * * @c cxxomfort::fix::knuth_b - for broken std in MSVC 2010.
 *
 * Pending:
 * 
 * * @c generate_canonical complementary (C++11).
 * * @c uniform_int_distribution complementary (C++11).
 * * @c discrete_distribution complementary (C++11).
 *
 * @section also See Also
 * 
 * @see @cppref{header/random} (cppreference)
 * @see @ref cxxo-sup-random (supplemental)

 * 
 * */

Changes to cxxomfort/cxxomfort/string.hpp.

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
/**
 * @page std0string <string>
 * @brief Backports related to Standard header <tt><string></tt>
 * 
 * 
 * @code
 * #include <cxxomfort/string.hpp>


 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)


 * Interfaces defined in this section:
 * 
 * * @c @link cxxomfort::cxxostd::to_string to_string() @endlink (C++11) - convert C++ integers/floats into strings.
 * * Overloads include @c to_string(short) , @c to_string(long) , @c to_string(double) etc.
 * * @c strtoll() , @c strtoull() function family (C++11) - convert strings into @c long s.
 * * <tt>hash<></tt> specialization for @c std::basic_string where not available.
 * 
 * Future / potential interfaces:
 * 
 * * @c string user-defined literal
 * 
 * @subsection also "See Also"
 * 
 * * @ref @cppref{header/string}
 * * @ref std0string_view "string_view backports"
 * * @ref cxxo-sup-string
 * 
 *
 * */







>
>


<
>
>











|

|
|
|



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
/**
 * @page std0string <string>
 * @brief Backports related to Standard header <tt><string></tt>
 * 
 * 
 * @code
 * #include <cxxomfort/string.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 

 * @section Interfaces
 * 
 * Interfaces defined in this section:
 * 
 * * @c @link cxxomfort::cxxostd::to_string to_string() @endlink (C++11) - convert C++ integers/floats into strings.
 * * Overloads include @c to_string(short) , @c to_string(long) , @c to_string(double) etc.
 * * @c strtoll() , @c strtoull() function family (C++11) - convert strings into @c long s.
 * * <tt>hash<></tt> specialization for @c std::basic_string where not available.
 * 
 * Future / potential interfaces:
 * 
 * * @c string user-defined literal
 * 
 * @section also "See Also"
 * 
 * * @see @cppref{header/string} (cppreference)
 * * @see @ref std0string_view "string_view backports"
 * * @see @ref cxxo-sup-string
 * 
 *
 * */

Changes to cxxomfort/cxxomfort/string_view.hpp.

1
2
3
4
5

6
7
8
9

10
11
12
13
14
15
16
..
45
46
47
48
49
50
51

52
53
54
55
56
57
58
..
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
#ifndef CXXOMFORT_STRING_VIEW_HPP
#define CXXOMFORT_STRING_VIEW_HPP

#if (CXXOMFORT_CXX_STD >= 2017)
	#include <string_view>


#elif (CXXOMFORT_CXX_STD >= 1997)
	#include "system_error.hpp"
	#include "impl/17-string_view.hpp"

//#include "impl/17-hash_string_view.hpp"

namespace std {
    using cxxomfort::cxxostd::basic_string_view;
    using cxxomfort::cxxostd::string_view;
    using cxxomfort::cxxostd::wstring_view;
}
................................................................................

	#endif


#else // C++ pre 97

	#include "impl/17-string_view.hpp"


namespace std {
    using cxxomfort::cxxostd::basic_string_view;
    using cxxomfort::cxxostd::string_view;
    using cxxomfort::cxxostd::wstring_view;
}

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

/**
 * @page std0string_view <string_view>
 * @brief Backports related to Standard header <tt><string_view></tt> 
 * 
 * @code
 * #include <cxxomfort/string_view.hpp>



 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)


 * Interfaces defined here:
 * 
 * * @c @link cxxomfort::cxxostd::basic_string_view basic_string_view @endlink (C++17).
 * * the related typedefs eg.: @c string_view .
 * * @c CXXOMFORT_IMPLEMENTS_stdheader_string_view - implementation status for the above.
 * 
 * For differences between the implementation of <tt>string_view</tt> 
 * here vs standard, check the notices at <tt> @link cxxomfort::cxxostd::basic_string_view basic_string_view @endlink </tt>

 * Fix (non-backport) interfaces:
 * 
 * * @c cxxomfort::fix::make_string_view() - Makes a @c string_view from a std::string or a literal string.
 * 




 * @subsection also "See Also"
 * 
 * * @ref @cppref{header/string_view} , @ref @cppref{string/basic_string_view}
 * * @ref std0string "<string> backports"
 * 
 * 
 * */





>




>







 







>







 







>
>
>


<
>
>








>




>
>
>
>
|

|
|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
..
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
#ifndef CXXOMFORT_STRING_VIEW_HPP
#define CXXOMFORT_STRING_VIEW_HPP

#if (CXXOMFORT_CXX_STD >= 2017)
	#include <string_view>
	#define CXXOMFORT_IMPLEMENTS_header_string_view CXXO_IMPLSTATUS_NATIVE()

#elif (CXXOMFORT_CXX_STD >= 1997)
	#include "system_error.hpp"
	#include "impl/17-string_view.hpp"
	#define CXXOMFORT_IMPLEMENTS_header_string_view CXXO_IMPLSTATUS_BACKPORT()
//#include "impl/17-hash_string_view.hpp"

namespace std {
    using cxxomfort::cxxostd::basic_string_view;
    using cxxomfort::cxxostd::string_view;
    using cxxomfort::cxxostd::wstring_view;
}
................................................................................

	#endif


#else // C++ pre 97

	#include "impl/17-string_view.hpp"
	#define CXXOMFORT_IMPLEMENTS_header_string_view CXXO_IMPLSTATUS_BACKPORT()

namespace std {
    using cxxomfort::cxxostd::basic_string_view;
    using cxxomfort::cxxostd::string_view;
    using cxxomfort::cxxostd::wstring_view;
}

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

/**
 * @page std0string_view <string_view>
 * @brief Backports related to Standard header <tt><string_view></tt> 
 * 
 * @code
 * #include <cxxomfort/string_view.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * #include <cxxomfort/ostream.hpp>
 * @endcode
 * 

 * @section Interfaces
 * 
 * Interfaces defined here:
 * 
 * * @c @link cxxomfort::cxxostd::basic_string_view basic_string_view @endlink (C++17).
 * * the related typedefs eg.: @c string_view .
 * * @c CXXOMFORT_IMPLEMENTS_stdheader_string_view - implementation status for the above.
 * 
 * For differences between the implementation of <tt>string_view</tt> 
 * here vs standard, check the notices at <tt> @link cxxomfort::cxxostd::basic_string_view basic_string_view @endlink </tt>
 * 
 * Fix (non-backport) interfaces:
 * 
 * * @c cxxomfort::fix::make_string_view() - Makes a @c string_view from a std::string or a literal string.
 * 
 * Future / potential interfaces:
 * 
 * * @c string_view user-defined literal
 * 
 * @section also "See Also"
 * 
 * * @see @cppref{header/string_view} , @ref @cppref{string/basic_string_view}
 * * @see @ref std0string "<string> backports"
 * 
 * 
 * */

Changes to cxxomfort/cxxomfort/system_error.hpp.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	#pragma message CXXO_NOTICE("enabled <system_error> support.")
#endif

/*
 * Notes
 * 
 * C++>C++11  has <system_error>
 * MSVC 2010 with C++<C++11 has a borked <system_error> with badd errc
 * 
 * */

#if (CXXOMFORT_CXX_STD>=2011)

	#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_NATIVE()
	#include <system_error>
................................................................................
} }


#elif (CXXO_CXXSTDHEADER_system_error)
	#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_NATIVE()
	#include <system_error>

	#if (CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, >= 1600))
		#pragma message ("header system_error in MSVC")

namespace cxxomfort { namespace fix {
	using std::errc::errc;
} }
	#else








|







 







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
..
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
	#pragma message CXXO_NOTICE("enabled <system_error> support.")
#endif

/*
 * Notes
 * 
 * C++>C++11  has <system_error>
 * MSVC 2010, 2012 with C++<C++11 has a borked <system_error> with bad errc
 * 
 * */

#if (CXXOMFORT_CXX_STD>=2011)

	#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_NATIVE()
	#include <system_error>
................................................................................
} }


#elif (CXXO_CXXSTDHEADER_system_error)
	#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_NATIVE()
	#include <system_error>

	#if (CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, >= 1600) && CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, < 1800))
		#pragma message ("header system_error in MSVC")

namespace cxxomfort { namespace fix {
	using std::errc::errc;
} }
	#else

Changes to cxxomfort/cxxomfort/tuple.hpp.

85
86
87
88
89
90
91








92
93
94
95
96
97
98
99
100
101

#endif

/**
 * @page std0tuple <tuple>
 * @brief Backports related to Standard header <tt><tuple></tt> 
 * 








 * Interfaces defined here:
 * 
 * * @c get<tuple>() ( @ref std_get_type_tuple ) (C++14) - get elements of a tuple by type.
 * * @c apply() (C++17) - call a functor, unpacking a tuple for the arguments.
 * * @c make_from_tuple() (C++17) - construct an object unpacking a tuple for constructor arguments.
 * 
 * See also: @ref std0utility , @ref cxxo-sup-tuple ,
 * <a href="https://en.cppreference.com/w/cpp/header/tuple">\<tuple\> \@cppreference</a>.
 * 
 * */







>
>
>
>
>
>
>
>










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

#endif

/**
 * @page std0tuple <tuple>
 * @brief Backports related to Standard header <tt><tuple></tt> 
 * 
 * @code
 * #include <cxxomfort/tuple.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * @endcode
 * 
 * @section Interfaces
 * 
 * Interfaces defined here:
 * 
 * * @c get<tuple>() ( @ref std_get_type_tuple ) (C++14) - get elements of a tuple by type.
 * * @c apply() (C++17) - call a functor, unpacking a tuple for the arguments.
 * * @c make_from_tuple() (C++17) - construct an object unpacking a tuple for constructor arguments.
 * 
 * See also: @ref std0utility , @ref cxxo-sup-tuple ,
 * <a href="https://en.cppreference.com/w/cpp/header/tuple">\<tuple\> \@cppreference</a>.
 * 
 * */

Changes to cxxomfort/cxxomfort/type_traits.hpp.

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
...
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
...
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
...
703
704
705
706
707
708
709


710
711
712
713
714
715
716
...
722
723
724
725
726
727
728
729
730

731
732


733
734
735
736
737
738
739
740
741
742

743

744
745
746
747
748
749
750
	#endif
	
	// 
	// compilers that at least take some decent c++03
	// 
	
	#include "impl/11-conditional.hpp"	
	#include "util/meta.hpp" // enable_if etc


	#include "impl/using_tr1_type_traits.hpp"


	#include "impl/11-decay.hpp"
	#include "impl/11-underlying_type.hpp"
	#include "impl/11-common_type.hpp"
	#include "impl/11-is_tn_xble.hpp"

#else // CXX_STD < 1997 / no <type_traits>
................................................................................

	using ::cxxomfort::traits::is_scalar;
	using ::cxxomfort::traits::is_compound;

	#endif


	// EXPECT
	//#include <type_traits> // <-- vendor?
	#include "impl/using_tr1_type_traits.hpp"

	#include "impl/11-decay.hpp"
	#include "impl/11-is_tn_xble.hpp"


#endif // CXX_STD
................................................................................

#if (CXXOMFORT_CXX_STD>= 1997 && CXXOMFORT_CXX_STD<2011)
	#if (CXXOMFORT_CXX_EMULATION >= 2007)
	#else
	#endif
#endif

#if (CXXOMFORT_CXX_STD>=1997)


/*
 * "to_integral", "to_bool" conversion helpers for 
 * integral_constant in the contexts where they don't feature the 
 * integral conversion operator (eg.: pre-C++11).
 * */

namespace cxxomfort { namespace fix {







template <typename T, T t>

inline T to_integral (std::integral_constant<T,t>) CXXO_NOEXCEPTNOTHROW {
	return t;
}


CXXO_CONSTEXPR inline bool to_bool (std::false_type) CXXO_NOEXCEPTNOTHROW { return false; }

CXXO_CONSTEXPR inline bool to_bool (std::true_type) CXXO_NOEXCEPTNOTHROW { return true; }


}} // cxxomfort::fix






/*
 * remove_cvref, from c++20
 * */

#if (CXXOMFORT_CXX_STD>=2020)
	#define CXXOMFORT_IMPLEMENTS_p0550 CXXO_IMPLSTATUS_NATIVE()
................................................................................
#endif // c++11 mode or type_traits emulation


/*
 * remove_all_extents (C++11)
 * */
#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, >= 1700 )) // MSVC 2010 onwards defines remove_all_extents
#else
namespace std {
	using cxxomfort::traits::remove_all_extents;
}
#endif

/*
................................................................................
#endif // CXX_STD >= 1997

#endif // #include guard

/**
 * @page std0type_traits <type_traits>
 * @brief cxxomfort backports for <type_traits>


 * 
 * Interfaces provided by this header include:
 * 
 * * The family of traits defined in C++ TR1, if they were not already available.
 * * @c is_lvalue_reference - brought to C++03 as a mirror to @c is_reference (C++11).
 * * @c is_rvalue_reference - identifies rvalue references (always @e false in C++03).
 * * @c @ref std::decay "decay<T>" - perform implicit decay on a type.
................................................................................
 * * @c is_null_pointer (C++14) - identifies @c std::nullptr_t .
 * * @c void_t , @c make_void - generic, type-absorbing @c void transformations (C++17).
 * * @ref @c cxxomfort::cxxostd::bool_constant "std::bool_constant"  (C++17).
 * * @c @ref remove_cvref (C++20).
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * <tt>to_integral()</tt> for <tt>integral_constant</tt>.
 * * <tt>to_bool()</tt> for <tt>false_type</tt>, <tt>true_type</tt>.

 * * @link cxxomfort::fix::common_type @c common_type @endlink - 
 * implements "variadic" @c common_type in MSVC 2010, MSVC 2012 where it has issues, or refers to @c std::common_type otherwise.


 * 
 * @attention General notes:
 * 
 * * A number of traits depend on <b>compiler intrinsics</b>. 
 * If they are not available, the library does not compile correctly.
 * * In compilers without at least @c \_\_typeof__ support, 
 * @c common_type may not resolve correctly.
 * * In older compilers 
 * @c underlying_type may not resolve correctly.
 * 

 * 

 * See also @link cxxo-sup-type_traits Supplemental type_traits @endlink for other 
 * traits and transformations available in cxxomfort.
 * 
 * General notes:
 * 
 * 
 */







<

<

<







 







<
<







 







<
<









>
>
>
>
>
>

>
|



>

>




>
>
>
>
>







 







|







 







>
>







 







|

>


>
>



<
|
|
<
<
|

>

>
|
<

<
|
<
<
26
27
28
29
30
31
32

33

34

35
36
37
38
39
40
41
...
102
103
104
105
106
107
108


109
110
111
112
113
114
115
...
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
...
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
...
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
...
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747

748
749


750
751
752
753
754
755

756

757


	#endif
	
	// 
	// compilers that at least take some decent c++03
	// 
	
	#include "impl/11-conditional.hpp"	



	#include "impl/using_tr1_type_traits.hpp"


	#include "impl/11-decay.hpp"
	#include "impl/11-underlying_type.hpp"
	#include "impl/11-common_type.hpp"
	#include "impl/11-is_tn_xble.hpp"

#else // CXX_STD < 1997 / no <type_traits>
................................................................................

	using ::cxxomfort::traits::is_scalar;
	using ::cxxomfort::traits::is_compound;

	#endif




	#include "impl/using_tr1_type_traits.hpp"

	#include "impl/11-decay.hpp"
	#include "impl/11-is_tn_xble.hpp"


#endif // CXX_STD
................................................................................

#if (CXXOMFORT_CXX_STD>= 1997 && CXXOMFORT_CXX_STD<2011)
	#if (CXXOMFORT_CXX_EMULATION >= 2007)
	#else
	#endif
#endif




/*
 * "to_integral", "to_bool" conversion helpers for 
 * integral_constant in the contexts where they don't feature the 
 * integral conversion operator (eg.: pre-C++11).
 * */

namespace cxxomfort { namespace fix {

/**
 * @brief Recovers the value corresponding to a <tt>integral_constant</tt>.
 * 
 * This function is a helper for versions of C++ pre-C++14 which introduced the <tt>integral_constant</tt> conversion operator.
 * 
 * */
template <typename T, T t>
CXXO_CONSTEXPR inline 
T to_integer (std::integral_constant<T,t>) CXXO_NOEXCEPTNOTHROW {
	return t;
}

//! Helper function to return the value corresponding to a <tt>false_type</tt>.
CXXO_CONSTEXPR inline bool to_bool (std::false_type) CXXO_NOEXCEPTNOTHROW { return false; }
//! Helper function to return the value corresponding to a <tt>true_type</tt>.
CXXO_CONSTEXPR inline bool to_bool (std::true_type) CXXO_NOEXCEPTNOTHROW { return true; }


}} // cxxomfort::fix



#if (CXXOMFORT_CXX_STD>=1997)


/*
 * remove_cvref, from c++20
 * */

#if (CXXOMFORT_CXX_STD>=2020)
	#define CXXOMFORT_IMPLEMENTS_p0550 CXXO_IMPLSTATUS_NATIVE()
................................................................................
#endif // c++11 mode or type_traits emulation


/*
 * remove_all_extents (C++11)
 * */
#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXO_COMPILERREQ(CXXO_COMPILERID_MSC, >= 1600 )) // MSVC 2010 onwards defines remove_all_extents
#else
namespace std {
	using cxxomfort::traits::remove_all_extents;
}
#endif

/*
................................................................................
#endif // CXX_STD >= 1997

#endif // #include guard

/**
 * @page std0type_traits <type_traits>
 * @brief cxxomfort backports for <type_traits>
 * 
 * @section Interfaces
 * 
 * Interfaces provided by this header include:
 * 
 * * The family of traits defined in C++ TR1, if they were not already available.
 * * @c is_lvalue_reference - brought to C++03 as a mirror to @c is_reference (C++11).
 * * @c is_rvalue_reference - identifies rvalue references (always @e false in C++03).
 * * @c @ref std::decay "decay<T>" - perform implicit decay on a type.
................................................................................
 * * @c is_null_pointer (C++14) - identifies @c std::nullptr_t .
 * * @c void_t , @c make_void - generic, type-absorbing @c void transformations (C++17).
 * * @ref @c cxxomfort::cxxostd::bool_constant "std::bool_constant"  (C++17).
 * * @c @ref remove_cvref (C++20).
 * 
 * Non-backport interfaces (<tt>cxxomfort::fix</tt>):
 * 
 * * <tt>to_integer()</tt> for <tt>integral_constant</tt>.
 * * <tt>to_bool()</tt> for <tt>false_type</tt>, <tt>true_type</tt>.
 * * <tt>to_value()</tt> (synonym of @c to_integer() ) for <tt>integral_constant</tt>.
 * * @link cxxomfort::fix::common_type @c common_type @endlink - 
 * implements "variadic" @c common_type in MSVC 2010, MSVC 2012 where it has issues, or refers to @c std::common_type otherwise.
 * 
 * @section Notes 
 * 
 * @attention General notes:
 * 

 * * A number of traits depend on <b>compiler intrinsics</b>, including @c is_empty and @c is_pod . If they are not available, the library does not compile correctly.
 * * In compilers without at least @c \_\_typeof__ support, @c common_type may not resolve correctly.


 * * In older compilers @c underlying_type may not resolve correctly.
 * 
 * @section also See Also
 * 
 * * @see @ref @cppref{header/type_traits}
 * * See also @link cxxo-sup-type_traits Supplemental type_traits @endlink for other traits and transformations available in cxxomfort.

 * 

 */


Changes to cxxomfort/cxxomfort/typeindex.hpp.

64
65
66
67
68
69
70
71









72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
CXXO_STDTR1_CLOSE()
#endif // no_std_using

#endif

/**
 * @page std0typeindex <typeindex>
 * @brief Backports related to Standard header <tt><typeindex></tt> 









 * 
 * From C++11 onwards, <tt><typeindex></tt> provides an utility that 
 * allows using <tt>type_info</tt> information in a way that is indexable 
 * as criteria for eg.: a <tt>std::map</tt>.
 * 
 * Interfaces defined in this section:
 * 
 * * @c std::type_index - Hashable form of @c <tt>std::type_info</tt> (see @c @ref cxxomfort::cxxostd::typeindex "typeindex" ).
 * 
 * 
 * @subsection also See Also
 * 
 * * @see @cppref{header/typeindex} 
 * 
 */








|
>
>
>
>
>
>
>
>
>









<
|





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
CXXO_STDTR1_CLOSE()
#endif // no_std_using

#endif

/**
 * @page std0typeindex <typeindex>
 * @brief Backports related to Standard header <tt>\<typeindex\></tt> 
 * 
 * @code
 * #include <cxxomfort/typeindex.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * #include <cxxomfort/library.hpp>
 * @endcode
 * 
 * @section Interfaces 
 * 
 * From C++11 onwards, <tt><typeindex></tt> provides an utility that 
 * allows using <tt>type_info</tt> information in a way that is indexable 
 * as criteria for eg.: a <tt>std::map</tt>.
 * 
 * Interfaces defined in this section:
 * 
 * * @c std::type_index - Hashable form of @c <tt>std::type_info</tt> (see @c @ref cxxomfort::cxxostd::typeindex "typeindex" ).
 * 

 * @section also See Also
 * 
 * * @see @cppref{header/typeindex} 
 * 
 */

Changes to cxxomfort/cxxomfort/util/memtraits.hpp.

208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228

    template <typename T>
    static void destroy (Alloc &a, T* p) { a.destroy(p); }
    static size_t max_size (Alloc const& a)  { return a.max_size(); }

};

// specialization of std::allocator_traits < std::allocator< T > > 
// that adds emplace construction

//template <typename T>
//struct allocator_traits <std::allocator<T> >{
//
//};


}
}

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







<
<
<
<
<
<
<







208
209
210
211
212
213
214







215
216
217
218
219
220
221

    template <typename T>
    static void destroy (Alloc &a, T* p) { a.destroy(p); }
    static size_t max_size (Alloc const& a)  { return a.max_size(); }

};










}
}

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

Deleted cxxomfort/cxxomfort/util/meta.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
#ifndef CXXOMFORT_UTIL_META_HPP
#define CXXOMFORT_UTIL_META_HPP
/**
 * @brief Implements some of the type_traits additions in C++03.
 * @author Luis Machuca Bezzaza <luis [dot] machuca [at] gulix [dot] cl>
 *
 * Interfaces defined in this header:
 *
 * * identity
 * * disable_if
 * * selection
 * * meta_and, meta_or
 * 
 */

#include <cxxomfort/config.hpp>
//#include "type_traits.hpp"
#include <cxxomfort/base/static_assert.hpp>
#include <cxxomfort/impl/11-conditional.hpp>
//#define CXXOMFORT_IMPLEMENTS_n2240 CXXO_IMPLSTATUS_LIBRARY()


namespace cxxomfort {

struct none_tag ;

/**
 * @brief Given a type T, define member ::type as T
 */
template <typename T>
struct identity {  typedef T type; };

/**
 * @brief Given an index V and a list of types T0, T1, T2, ...; find the type in the Vth position.
 */
template <unsigned V,
    typename T0, typename T1, typename T2= void, typename T3= void, typename T4= void,
    typename T5= void, typename T6= void, typename T7= void, typename T8= void, typename T9= void>
struct selection {};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<0, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T0 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<1, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T1 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<2, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T2 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<3, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T3 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<4, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T4 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<5, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T5 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<6, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T6 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<7, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T7 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<8, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T8 type;
};

template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<9, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> {
    typedef T9 type;
};

// this is for failures in iteration
template <
    typename T0, typename T1, typename T2, typename T3, typename T4,
    typename T5, typename T6, typename T7, typename T8, typename T9
> struct selection<10, T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> ;

/*
 * meta_and, meta_or
 * Given a list of boolean traits Bools..., 
 * sets ::value as the AND / OR of their ::values
 */
#if (CXXOMFORT_CXX_STD >= 2011 || defined(DOXYGEN_DOC))

template <typename... Bools>
struct meta_and; // make compiler happy

// at least 2 arguments
template <typename B0, typename... Bools>
struct meta_and<B0,Bools...>
: std::integral_constant<
bool, (B0::value and meta_and<Bools...>::value)
> {};

template <typename B0>
struct meta_and<B0> : std::integral_constant<bool, B0::value> {};

template <typename... Bools>
struct meta_or; // make compiler happy

// at least 2 arguments
template <typename B0, typename... Bools>
struct meta_or<B0,Bools...>
: std::integral_constant<
bool, (B0::value or meta_and<Bools...>::value)
> {};

#else
// non-variadic up to 10 args, non-recursive

/*
template <
    typename B0, typename B1, 
    typename B2= traits::true_type, typename B3= traits::true_type,
    typename B4= traits::true_type, typename B5= traits::true_type,
    typename B6= traits::true_type, typename B7= traits::true_type,
    typename B8= traits::true_type, typename B9= traits::true_type
> struct meta_and
: traits::integral_constant< 
bool, (B0::value && B1::value && B2::value && B3::value && B4::value 
    && B5::value && B6::value && B7::value && B8::value && B9::value)
> {};

template <
    typename B0, typename B1, 
    typename B2= traits::false_type, typename B3= traits::false_type,
    typename B4= traits::false_type, typename B5= traits::false_type,
    typename B6= traits::false_type, typename B7= traits::false_type,
    typename B8= traits::false_type, typename B9= traits::false_type
> struct meta_or
: traits::integral_constant< 
bool, (B0::value || B1::value || B2::value || B3::value || B4::value 
    || B5::value || B6::value || B7::value || B8::value || B9::value)
> {};

*/

#endif

//
// conditional_if
// (select type according to a trait
//

#if 0
namespace detail_conditional {

template <template<typename> class Trait, int Idx, int N, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
struct helper {
    typedef typename selection<Idx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>::type test_T;
    enum { value = 
    (traits::is_same<test_T,none_tag>::value ? -1 : 
    (Trait<test_T>::value ? Idx : helper<Trait, Idx+1, N, T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::value )
    )
    };
};

template <template<typename> class Trait, int N, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9, typename T10>
struct helper<Trait,N,N,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10> {
    static_assert( (N!=0) , "Sequence of types in conditional_if helper did not find a type");
    enum { value = N };
};


}

template <template <typename> class Trait, 
    typename T1, 
    typename T2=T1, typename T3=T1, typename T4=T1, typename T5=T1, 
    typename T6=T1, typename T7=T1, typename T8=T1, typename T9=T1, 
    typename T10=T1
> struct conditional_if {
    private:
    static const int value = detail_conditional::helper<Trait,0,10,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::value;
    public:
    typedef typename selection<value, T1,T2,T3,T4,T5,T6,T7,T8,T9,T10>::type type;

};

template <template <typename> class Trait, typename T>
struct conditional_if<Trait, T> 
: conditional<Trait<T>::value, T, none_tag> {};

#endif

}//~cxxomfort

#if CXXOMFORT_CXX_STD < 2011
#if (CXXO_COMPILER_SUPPORT_std_metaprogramming_helpers == 0)
    #define CXXOMFORT_USING_METAPROGRAMMING_HELPERS 1
#endif
#endif

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


// Example usages
// http://stackoverflow.com/questions/7693703/can-i-use-something-like-enable-if-with-an-implicit-conversion-operator?rq=1
//
//

#endif // USING

#endif // file
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<












































































































































































































































































































































































































































































































Changes to cxxomfort/cxxomfort/utility.hpp.

11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
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

#include "config.hpp"
#include "base.hpp"   // move, forward
#include CXXO_INCLUDE_SYS(utility)

#if (CXXOMFORT_CXX_STD >= 1997)

#include "util/meta.hpp"
#include "impl/07-type_traits.hpp"

//#include "type_traits.hpp"
//USING

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

/**
 * @page std0utility <utility>
 * @brief Backports related to Standard Header <tt><utility></tt> 
 * 
 * @code
 * #include <cxxomfort/utility.hpp>




 * @endcode
 * 
 * (or automatically by including <tt><cxxomfort/backports.hpp></tt> / <tt><cxxomfort/cxxomfort.hpp></tt>)

 * 
 * Interfaces defined in this file:
 * 
 * * @c move() (C++11) - moves an object from an "rvalue reference".
 * * @c declval() (C++11) - declare variables in an unevaluated context.
 * * @c exchange() (C++14) - propagate a modification to two variables.
 * * @c integer_sequence , @c index_sequence (C++14) (from C++11 onward only).
 * * @c as_const() , @c as_ptr_const() (C++17) - a <tt>const</tt> view of data.
 * * @c in_place_t , @c in_place_type_t (C++17).
 *
 * See also @ref std0type_traits , @ref std0tuple , 
 * <a href="https://en.cppreference.com/w/cpp/header/utility">\<utility\> \@cppreference</a>.

 * 
 * See also @ref cxxo-sup-utility (supplemental).
 * 
 * */







<







 







>
>
>
>


<
>










|
|
>




11
12
13
14
15
16
17

18
19
20
21
22
23
24
...
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

#include "config.hpp"
#include "base.hpp"   // move, forward
#include CXXO_INCLUDE_SYS(utility)

#if (CXXOMFORT_CXX_STD >= 1997)


#include "impl/07-type_traits.hpp"

//#include "type_traits.hpp"
//USING

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

/**
 * @page std0utility <utility>
 * @brief Backports related to Standard Header <tt><utility></tt> 
 * 
 * @code
 * #include <cxxomfort/utility.hpp>
 * // or as part of:
 * #include <cxxomfort/backports.hpp>
 * #include <cxxomfort/type_traits.hpp>
 * #include <cxxomfort/library.hpp>
 * @endcode
 * 

 * @section Interfaces
 * 
 * Interfaces defined in this file:
 * 
 * * @c move() (C++11) - moves an object from an "rvalue reference".
 * * @c declval() (C++11) - declare variables in an unevaluated context.
 * * @c exchange() (C++14) - propagate a modification to two variables.
 * * @c integer_sequence , @c index_sequence (C++14) (from C++11 onward only).
 * * @c as_const() , @c as_ptr_const() (C++17) - a <tt>const</tt> view of data.
 * * @c in_place_t , @c in_place_type_t (C++17).
 *
 * @section also See Also
 * 
 * See also @ref std0type_traits , @ref std0tuple , @cppref{header/utility}
 * 
 * See also @ref cxxo-sup-utility (supplemental).
 * 
 * */

Changes to cxxomfort/cxxomfort/various.hpp.

43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
 * integral_of_size
 * 
 * @brief Query if an integral with the given size exists
 * 
 */

#include "impl/07-type_traits.hpp"
#include "util/meta.hpp"      // enable_if, etc...
#include "utility.hpp"
//#include "using.hpp"


/*
 * is_any_of
 */







<







43
44
45
46
47
48
49

50
51
52
53
54
55
56
 * integral_of_size
 * 
 * @brief Query if an integral with the given size exists
 * 
 */

#include "impl/07-type_traits.hpp"

#include "utility.hpp"
//#include "using.hpp"


/*
 * is_any_of
 */

Changes to cxxomfort/tags/cxxomfort.cpp.tags.

9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
..
73
74
75
76
77
78
79


80
81
82
83



84
85
86
87
88
89
90
# @version 3
#library general
arrayref|array_ref<T>|(T&[N])|
carrayref|array_ref<T const>|(T[N])|
carrayref|array_ref<T const>|(array_ref)|
seq_|"sequence type"|<T>(), sequence of T...|
to_byte|std::byte|(Integral byte)|
to_errc|std::errc|(integral errc_value)|

typeid_demangle|std::string|(typeid construct)|
type_name|std::string_view|<T>() [parametrized on T]|
#algorithm
copy_leftmost_n|ItDest|(ItSrc ini, ItSrc fin, Integer n, ItDest dest)|
copy_rightmost_n|ItDest|(ItSrc ini, ItSrc fin, Integer n, ItDest dest)|
count_frequencies_map|Iterator|(Iterator ini, Iterator fin, ValueMapIndex[]& v)|
find_inversion|Iterator|(Iterator ini, Iterator fin, Comparison less)|
................................................................................
none_on|bool|[FuncIterator ini, FuncIterator fin, Value v)|
#functional
ptr_fun|nullary_functor|(Ret(*fn)())|
constant_fn|constant_function<T>|(T t)|
make_equivalence|equivalent_to<void>|()|
fnref|function_ref<Signature>|(function or functoid name)|
#iterator
ssize|ptrdiff_t|(Object&)|
make_fake_iterator|fake_iterator|(T const& t)|
cexview|container_extension_view<Container>|(Container &)|
ccexview|container_extension_view<Container const>|(Container const &)|
#memory
to_bool|bool|(unique_ptr<T> const& resource)|
to_bool|bool|(shared_ptr<T> const& resource)|
#numeric
................................................................................
string_replace|string|(string const& from, string const& to, string content)|
to_string|std::string|(expressions..., )|
to_wstring|std::wstring|(expressions..., )|
string_cast|To|(From)|
#string_view
make_string_view|basic_string_view<Char>|(basic_string<Char>)|
make_string_view|basic_string_view<Char>|(Char[N])|


#tuple
tuple_index|with.[value]|<type, Tuple>|
tuple_shift|tuple<A_{2...n}>|(tuple<A_{1...n}>)|
tuple_pop|tuple<A_{1...n-1}>|(tuple<A_{1...n}>)|



#utility
as_bytes_view|const_bytes_view|(void* ptr, size_t len)|
as_bytes_view|const_bytes_view|(array_ref<T> view)|
hexdump|int|(array_ref<char> dest, const_bytes_view src)|
hexdump|int|(array_ref<char> dest, array_ref<char const> src)|
hexdump|int|(array_ref<char> dest, void* ptr, size_t size)|
hexload|int|(array_ref<byte> dest, string_view src)|







|
>







 







<







 







>
>




>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
33
34
35
36
37
38
39

40
41
42
43
44
45
46
..
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# @version 3
#library general
arrayref|array_ref<T>|(T&[N])|
carrayref|array_ref<T const>|(T[N])|
carrayref|array_ref<T const>|(array_ref)|
seq_|"sequence type"|<T>(), sequence of T...|
to_byte|std::byte|(Integral byte)|
to_integer|unsigned char|(std::byte)|
to_value|unsigned char|(std::byte)|
typeid_demangle|std::string|(typeid construct)|
type_name|std::string_view|<T>() [parametrized on T]|
#algorithm
copy_leftmost_n|ItDest|(ItSrc ini, ItSrc fin, Integer n, ItDest dest)|
copy_rightmost_n|ItDest|(ItSrc ini, ItSrc fin, Integer n, ItDest dest)|
count_frequencies_map|Iterator|(Iterator ini, Iterator fin, ValueMapIndex[]& v)|
find_inversion|Iterator|(Iterator ini, Iterator fin, Comparison less)|
................................................................................
none_on|bool|[FuncIterator ini, FuncIterator fin, Value v)|
#functional
ptr_fun|nullary_functor|(Ret(*fn)())|
constant_fn|constant_function<T>|(T t)|
make_equivalence|equivalent_to<void>|()|
fnref|function_ref<Signature>|(function or functoid name)|
#iterator

make_fake_iterator|fake_iterator|(T const& t)|
cexview|container_extension_view<Container>|(Container &)|
ccexview|container_extension_view<Container const>|(Container const &)|
#memory
to_bool|bool|(unique_ptr<T> const& resource)|
to_bool|bool|(shared_ptr<T> const& resource)|
#numeric
................................................................................
string_replace|string|(string const& from, string const& to, string content)|
to_string|std::string|(expressions..., )|
to_wstring|std::wstring|(expressions..., )|
string_cast|To|(From)|
#string_view
make_string_view|basic_string_view<Char>|(basic_string<Char>)|
make_string_view|basic_string_view<Char>|(Char[N])|
#system_error
to_errc|std::errc|(integral errc_value)|
#tuple
tuple_index|with.[value]|<type, Tuple>|
tuple_shift|tuple<A_{2...n}>|(tuple<A_{1...n}>)|
tuple_pop|tuple<A_{1...n-1}>|(tuple<A_{1...n}>)|
#type_traits
to_integer|Integral|(std::integral_constant<Integral,N>)|
to_value|Integral|(std::integral_constant<Integral,N>)|
#utility
as_bytes_view|const_bytes_view|(void* ptr, size_t len)|
as_bytes_view|const_bytes_view|(array_ref<T> view)|
hexdump|int|(array_ref<char> dest, const_bytes_view src)|
hexdump|int|(array_ref<char> dest, array_ref<char const> src)|
hexdump|int|(array_ref<char> dest, void* ptr, size_t size)|
hexload|int|(array_ref<byte> dest, string_view src)|