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

Overview
Comment:Commit 2019-02-04 - Barebones implementations for C++<1997, and some compatibility fixes.
  • cxxomfort: Fixed identification of OpenWatcom 1.9, 2.0 (Per-Compiler Notes).
  • cxxomfort: Added a separate header for code generation macros.
  • array: Added barbeones feature for Watcom (Per-Compiler Notes).
  • cstddef: Pending extend backport of std::byte.
  • functional: Fixed transparent functors detected in MSVC 2013.
  • random: Disabled temporarily in C++<1997 mode.
  • string: Added operator<< for Watcom.
  • string_view: Reimplemented for C++<1997 mode.
  • string_view: Fixed ostream operator for C++<1997, basic_ostream<char> only.
  • system_error: Disabled in <1997 mode.
  • tuple: Disabled in <1997 mode (Per-Compiler Notes).
  • library: Disabled temporarily in <1997 mode (Per-Compiler Notes).
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | gcc_max_505 | msvc_max_1700 | pre-release | y2019 | clang_max_303
Files: files | file ages | folders
SHA3-256:d5f10c30b2b9ad6bfb54f61e01cad46b9e7384a7e38ecf2036229aa59769d4a7
User & Date: luismachuca 2019-02-03 23:21:01
Context
2019-02-14
03:15
Commit 2019-02-13 - Love-- for OpenWatcom; various minor fixes.
  • cxxomfort: Updated CHANGELOG.txt which missed out an update.
  • cxxomfort: Initial compatibility testings for MSVC 2005 compatibility (has no TR1).
  • config: CXXO_INCLUDE_SYS notices got demoted to notice level 3.
  • config: Added basic detection of MSVC 2005 (still not supported).
  • base: Base feature implementation notices got demoted to notice level 4.
  • cstddef: Reimplemented std::byte, with better compatibility for C++<97.
  • cstddef: Added std::byte support for MSVC 2005.
  • array: Added support for MSVC 2005.
  • system_error: Fixed forwarding of @ref cxxomfort::fix::errc for MSVC 2012.
  • type_traits: Added support for the "primary" traits in MSVC 2005.
  • library:algorithm: Add p1223 find_backward().
  • library:algorithm: Add p1223r0 find_not().
  • library:algorithm: Add lwg217 find() (binary predicate form).
check-in: 0ad1617a user: luismachuca tags: trunk, gcc_max_505, msvc_max_1700, y2019, gcc_min_404, msvc_min_1500, openwatcom_min_109, testing
2019-02-03
23:21
Commit 2019-02-04 - Barebones implementations for C++<1997, and some compatibility fixes.
  • cxxomfort: Fixed identification of OpenWatcom 1.9, 2.0 (Per-Compiler Notes).
  • cxxomfort: Added a separate header for code generation macros.
  • array: Added barbeones feature for Watcom (Per-Compiler Notes).
  • cstddef: Pending extend backport of std::byte.
  • functional: Fixed transparent functors detected in MSVC 2013.
  • random: Disabled temporarily in C++<1997 mode.
  • string: Added operator<< for Watcom.
  • string_view: Reimplemented for C++<1997 mode.
  • string_view: Fixed ostream operator for C++<1997, basic_ostream<char> only.
  • system_error: Disabled in <1997 mode.
  • tuple: Disabled in <1997 mode (Per-Compiler Notes).
  • library: Disabled temporarily in <1997 mode (Per-Compiler Notes).
check-in: d5f10c30 user: luismachuca tags: trunk, gcc_max_505, msvc_max_1700, pre-release, y2019, clang_max_303
2019-02-01
14:04
Commit 2019-02-01 - All these fixes have some traits in std::common.
  • cxxomfort: Fixed detection of Clang 3.x, 4.x and features.
  • cxxomfort: Fixed detection of namespace tr1 in Clang C++03 mode, STDLIB mode.
  • cxxomfort: Fixed to_byte missing cxxomfort::fix.
  • cxxomfort: Improved documentation.
  • config: Fixed the definition of CXXO_TYPEOF and scenarios.
  • config: Fixed (partial) OpenWatcom seeing C++03 features it can't compile with (templates).
  • cuchar: Fixed detection of typedefs in Clang (< 5.0).
  • functional: Fixed usage of tr1::hash in Clang C++03 mode.
  • memory: Fixed hash<unique_ptr> (C++03, MSVC, Clang).
  • string: Fixed hash<basic_string< > > (C++03, Clang).
  • type_traits: Fixed detection of traits in Clang in C++03 mode.
  • type_traits: Fixed forwarding of common_type for MSVC >= 2012.
  • library: Fixed type_name for Clang (< 5.0).
  • TBA: cxxomfort: Adjust for Clang with LIBCXX, in C++03 mode.
check-in: f5381a77 user: luismachuca tags: trunk, gcc_max_505, msvc_max_1700, pre-release, y2019, clang_max_303
Changes

Changes to cxxomfort/cxxomfort/array.hpp.

3
4
5
6
7
8
9

10
11
12
13

14
15
16




17
18
19
20
21
22
23
24
25
26
27
28
29
30




31
32
33
34
35
36
37
/**
 * @file
 *
 */

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


#if (CXXOMFORT_CXX_STD<1997)
#include "impl/03-array.hpp"
#else

#include <array>
#endif





#if (CXXOFLAG_namespace_tr1>0)

namespace std {
    using tr1::array;
    using tr1::get;
}

#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,<1600) )
namespace std {
	using tr1::array;
	using tr1::get;
}

#endif





#endif


/**
 * @page std0array <array>
 * @brief Backports from @c <array> 







>



<
>
|
|
|
>
>
>
>
|






|





|
>
>
>
>







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

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


#if (CXXOMFORT_CXX_STD<1997)
#include "impl/03-array.hpp"


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

#elif (CXXOMFORT_CXX_STD < 2011)

	#include <array>
	#if (CXXOFLAG_namespace_tr1>0)

namespace std {
    using tr1::array;
    using tr1::get;
}

	#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,<1600) )
namespace std {
	using tr1::array;
	using tr1::get;
}

	#endif

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

#endif


/**
 * @page std0array <array>
 * @brief Backports from @c <array> 

Changes to cxxomfort/cxxomfort/backports.hpp.

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
 * utilities as well as the available backports for the major 
 * standard headers in the library.
 * 
 * */
#include "config.hpp"
#include "base.hpp"

#include "array.hpp" // std::array
#include "algorithm.hpp" // <algorithm> backports (copy_if, minmax, etc...)
#include "cstddef.hpp" // <cstddef> backports (byte, nullptr, etc...)
#include "cstdint.hpp" // <cstdint> backports (integer types)





#include "cuchar.hpp" // <cuchar> backports: char16_t, char32_t
#include "forward_list.hpp" // std::forward_list



#include "functional.hpp" // <functional> backports (transparent functors, etc...)
#include "iterator.hpp" // <iterator> backports (begin, end, size, data, 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 "string.hpp" // <string> backports (to_string, etc...)
#include "string_view.hpp" // <string_view> backports
#include "system_error.hpp" // <system_error> backports
#include "tuple.hpp" // <tuple> backports (tuple get<type>, etc...)
#include "type_traits.hpp" // <type_traits> backports (common_type, decay, is_literal, is_null_pointer, etc...)
#include "typeindex.hpp" // std::type_index
#include "utility.hpp" // <utility> backports (declval, exchange, pair, etc...)

#endif







<



>
>
>
>
>


>
>
>

<



<
<



<
<


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
 * utilities as well as the available backports for the major 
 * standard headers in the library.
 * 
 * */
#include "config.hpp"
#include "base.hpp"


#include "algorithm.hpp" // <algorithm> backports (copy_if, minmax, etc...)
#include "cstddef.hpp" // <cstddef> backports (byte, nullptr, etc...)
#include "cstdint.hpp" // <cstdint> backports (integer types)
#include "iterator.hpp" // <iterator> backports (begin, end, size, data, etc...)
#include "string.hpp" // <string> backports (to_string, etc...)
#include "utility.hpp" // <utility> backports (declval, exchange, pair, etc...)

#include "array.hpp" // std::array
#include "cuchar.hpp" // <cuchar> backports: char16_t, char32_t
#include "forward_list.hpp" // std::forward_list
#include "string_view.hpp" // <string_view> backports
#include "typeindex.hpp" // std::type_index

#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 "system_error.hpp" // <system_error> backports
#include "tuple.hpp" // <tuple> backports (tuple get<type>, etc...)
#include "type_traits.hpp" // <type_traits> backports (common_type, decay, is_literal, is_null_pointer, etc...)



#endif

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

47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
..
72
73
74
75
76
77
78



79
80
81
82
83
84
85
..
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
    T value;
    
    //explicit_cast (T t) throw() 
    //: value (std::move(t)) {}

    explicit_cast (T const& t) throw ()
    : value(t) {}

    operator T () throw() {
        return std::move(value);
    }
    operator T const& () const throw () {
        return value;
    }
    
    private:
    explicit_cast () ;
    explicit_cast& operator= (explicit_cast const&) CXXOMFORT_CXX11_CODE( = delete, ;);
};

// we need special treatment if we want to explicit_cast to a reference type
template <typename T>
struct explicit_cast<T&> {
	T& ref;
................................................................................
	operator T& () const CXXO_NOEXCEPTNOTHROW { return ref; }
	private:
	explicit_cast ();
	explicit_cast& operator= (explicit_cast const&);
};

#else



// c++11-onward
// (note: some parts here should be constexpr)

template <typename T>
struct explicit_cast {
    T value;

................................................................................
        std::cout<< "[explicit_cast::inside constructor]"<< std::endl;
    }

    template <typename F >
    explicit_cast (F&& f)
    : value(std::forward<F>(f)) {}

    operator T /* const&*/ () noexcept { return std::move(value); }

    explicit_cast () = delete;
    explicit_cast& operator= (explicit_cast const&) = delete;
};


#endif

}
} // cxxomfort::

using ::cxxomfort::detail::explicit_cast;


#if (CXXOMFORT_CXX_STD<2011)

    #define CXXO_EXPLICIT_OPERATOR(T) operator ::cxxomfort::detail::explicit_cast<T> 


#else

    //#define explicit_cast static_cast
    #define CXXO_EXPLICIT_OPERATOR(T) explicit operator T 



#endif // c++<11

/*
template <typename T>
struct explicit_cast {
    T value;







<
<
<
<





<







 







>
>
>







 







|




>
>





<





>



|

>
>







47
48
49
50
51
52
53




54
55
56
57
58

59
60
61
62
63
64
65
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
..
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
    T value;
    
    //explicit_cast (T t) throw() 
    //: value (std::move(t)) {}

    explicit_cast (T const& t) throw ()
    : value(t) {}




    operator T const& () const throw () {
        return value;
    }
    
    private:

    explicit_cast& operator= (explicit_cast const&) CXXOMFORT_CXX11_CODE( = delete, ;);
};

// we need special treatment if we want to explicit_cast to a reference type
template <typename T>
struct explicit_cast<T&> {
	T& ref;
................................................................................
	operator T& () const CXXO_NOEXCEPTNOTHROW { return ref; }
	private:
	explicit_cast ();
	explicit_cast& operator= (explicit_cast const&);
};

#else
	#if 1
	//#define explicit_cast static_cast
	#else
// c++11-onward
// (note: some parts here should be constexpr)

template <typename T>
struct explicit_cast {
    T value;

................................................................................
        std::cout<< "[explicit_cast::inside constructor]"<< std::endl;
    }

    template <typename F >
    explicit_cast (F&& f)
    : value(std::forward<F>(f)) {}

    operator T const& () noexcept { return value; }

    explicit_cast () = delete;
    explicit_cast& operator= (explicit_cast const&) = delete;
};

	#endif
#endif

}
} // cxxomfort::




#if (CXXOMFORT_CXX_STD<2011)

    #define CXXO_EXPLICIT_OPERATOR(T) operator ::cxxomfort::detail::explicit_cast<T> 
using ::cxxomfort::detail::explicit_cast;

#else

    #define explicit_cast static_cast
    #define CXXO_EXPLICIT_OPERATOR(T) explicit operator T 

//using ::cxxomfort::detail::explicit_cast;

#endif // c++<11

/*
template <typename T>
struct explicit_cast {
    T value;

Added cxxomfort/cxxomfort/base/move-00.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
#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{


//
//                            move()
//

template <typename T>
inline T& move (T& t) {
  return x;
}


//
//                            forward()
//

template <typename T> inline
T const& forward (T const& v) CXXO_NOEXCEPTNOTHROW {
    return v;
}


} //::cxxomfort::


#define CXXO_NONCOPYABLE_MOVABLE(TYPE)\
        private:\
        TYPE(TYPE &);\
        TYPE& operator=(TYPE &);\
        public:\
        operator ::cxxomfort::rv<TYPE>&() \
        {  return *static_cast< ::cxxomfort::rv<TYPE>* >(this);  }\
        operator const ::cxxomfort::rv<TYPE>&() const \
        {  return *static_cast<const ::cxxomfort::rv<TYPE>* >(this);  }\
        private:\


#define CXXO_COPYABLE_MOVABLE(TYPE)\
        public:\
        TYPE& operator=(TYPE &t)\
        {  this->operator=(static_cast<const ::cxxomfort::rv<TYPE> &>(const_cast<const TYPE &>(t))); \
            return *this;\
        }\
        public:\
        operator ::cxxomfort::rv<TYPE>&() \
        {  return *static_cast< ::cxxomfort::rv<TYPE>* >(this);  }\
        operator const ::cxxomfort::rv<TYPE>&() const \
        {  return *static_cast<const ::cxxomfort::rv<TYPE>* >(this);  }\
        private:\

#define CXXO_COPYABLE_MOVABLE_NONASSIGNABLE(TYPE)\
        private:\
        TYPE& operator= (TYPE const&) CXXOMFORT_CXX11_CODE(=delete,);\
        public:\
        operator ::cxxomfort::rv<TYPE>&() \
        {  return *static_cast< ::cxxomfort::rv<TYPE>* >(this);  }\
        operator const ::cxxomfort::rv<TYPE>&() const \
        {  return *static_cast<const ::cxxomfort::rv<TYPE>* >(this);  }\
        private:\


#define CXXO_COPY_ASSIGN_REF(TYPE) const ::cxxomfort::rv< TYPE >&

#define CXXO_RV_REF(TYPE) ::cxxomfort::rv< TYPE >&

#define CXXO_FWD_REF(TYPE) TYPE const&

//
// Helps write a semi-variadic argument list, up to 5 arguments
#define CXXO_VARIADIC_SIGNATURE(name)                                       \
    template <typename Arg1> name ( CXXO_VARFN_ARG0 CXXO_FWD_REF(Arg1) );    \
    template <typename Arg1, typename Arg2>                                  \
    name ( CXXO_VARFN_ARG0 CXXO_FWD_REF(Arg1), CXXO_FWD_REF(Arg2) );         \
    template <typename Arg1, typename Arg2, typename Arg3>                   \
    name ( CXXO_VARFN_ARG0 CXXO_FWD_REF(Arg1), CXXO_FWD_REF(Arg2), CXXO_FWD_REF(Arg3) );      \
    template <typename Arg1, typename Arg2, typename Arg3, typename Arg4>    \
    name ( CXXO_VARFN_ARG0 CXXO_FWD_REF(Arg1), CXXO_FWD_REF(Arg2),           \
     CXXO_FWD_REF(Arg3), CXXO_FWD_REF(Arg4) );             \
    template <typename Arg1, typename Arg2, typename Arg3, typename Arg4, typename Arg5>     \
    name ( CXXO_VARFN_ARG0 CXXO_FWD_REF(Arg1), CXXO_FWD_REF(Arg2),           \
     CXXO_FWD_REF(Arg3), CXXO_FWD_REF(Arg4), CXXO_FWD_REF(Arg5) );           \


namespace std{
    using ::cxxomfort::move;
    using ::cxxomfort::forward;
}


#endif

Changes to cxxomfort/cxxomfort/config.hpp.

213
214
215
216
217
218
219























220
221
222
223
224
225
226
...
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433

434
435
436
437
438
439
440
    #define CXXOMFORT_ARCHITECTURE CXXO_VALUE_ARCH_i586
#elif defined(__arm__) || defined(_M_ARM) || defined (__thumb__)
    #define CXXOMFORT_ARCHITECTURE CXXO_VALUE_ARCH_arm
#else
    #define CXXOMFORT_ARCHITECTURE 0
#endif

























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

// Macros to conditionally generate keywords

................................................................................
#else
	// a shot in the dark?
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(expr) cxxo_typeof_not_available_t 
#endif


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

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


/**
 * @def CXXO_DELETED_COPY_CONSTRUCTOR
 * @ingroup cxxomfort-codegen
 * @brief Announces a deleted (unavailable) copy constructor.
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) Type (Type const&) = delete
    #define CXXO_DELETED_COPY_ASSIGN(Type) Type& operator= (Type const&) = delete
#else
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) private: Type (Type const&);public: 
    #define CXXO_DELETED_COPY_ASSIGN(Type) private: Type& operator= (Type const&); public: 
#endif

/**
 * */
// uses macro CXXO_SIG_CONDITION, to be set at call site, 
// to create conditional template/function arguments for SFINAE
#if (CXXOMFORT_CXX_STD >= 2011)
    #define CXXO_ENABLEIF_TEMPLATE() \
    , typename = typename std::enable_if< CXXO_SIGCONDITION >::type 
    #define CXXO_ENABLEIF_FUNCTION() 
#else
    #define CXXO_ENABLEIF_TEMPLATE() 
    #define CXXO_ENABLEIF_FUNCTION() \
    , typename std::enable_if< CXXO_SIGCONDITION >::type * = nullptr 
    
#endif


/*
 * Opens the namespace where tr1 extensions live
 * */
#if ((CXXOMFORT_CXX_STD < 2011) && (\
    (CXXOMFORT_CXX_EMULATION < 2011 && CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC) || \
    (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG) || \
    (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC && CXXOMFORT_COMPILER_VERSION < 1600) \
) )
	#define CXXOFLAG_namespace_tr1 1
    #define CXXO_namespace_tr1 std::tr1
    #define CXXO_OPEN_STDTR1() namespace std { namespace tr1 {
    #define CXXO_CLOSE_STDTR1() } }
    #if (defined(CXXOMFORT_NOTICES) && CXXOMFORT_NOTICES > 1)
		#pragma message CXXO_NOTICE ("namespace tr1")
	#endif
#else 
	#define CXXOFLAG_namespace_tr1 0
    #define CXXO_namespace_tr1 std
    #define CXXO_OPEN_STDTR1() namespace std { 
    #define CXXO_CLOSE_STDTR1() } 
#endif

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

/*
 * Set up the minimal configuration.
 * This loads three headers whose features are used all across this library.
 */
//#include CXXO_INCLUDE_SYS(cstddef) // namespace std, etc
//#include CXXO_INCLUDE_SYS(cstdlib) // basic system
//#include CXXO_INCLUDE_SYS(iterator) // basics for iterator


#include "config/_has.hpp"
#define _CXXOMFORT_IMPLEMENTS(nn) (( CXXO_JOIN(CXXOMFORT_IMPLEMENTS_n,nn) > 0))
#define CXXOMFORT_IMPLEMENTS(nn) _CXXOMFORT_IMPLEMENTS(nn)

// this command in a shell reveals all nxxxx proposals implemented by this library:
// find -type f -iname '*.hpp' | xargs egrep -o "CXXOMFORT_IMPLEMENTS_n([0-9]+)\b"








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







 







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




<
<
<
<
<
<
<
<
>







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
...
353
354
355
356
357
358
359





















































































360
361
362
363








364
365
366
367
368
369
370
371
    #define CXXOMFORT_ARCHITECTURE CXXO_VALUE_ARCH_i586
#elif defined(__arm__) || defined(_M_ARM) || defined (__thumb__)
    #define CXXOMFORT_ARCHITECTURE CXXO_VALUE_ARCH_arm
#else
    #define CXXOMFORT_ARCHITECTURE 0
#endif


/*
 * Opens the namespace where tr1 extensions live
 * */
#if ((CXXOMFORT_CXX_STD < 2011) && (\
    (CXXOMFORT_CXX_EMULATION < 2011 && CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC) || \
    (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_CLANG) || \
    (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC && CXXOMFORT_COMPILER_VERSION < 1600) \
) )
	#define CXXOFLAG_namespace_tr1 1
    #define CXXO_namespace_tr1 std::tr1
    #define CXXO_OPEN_STDTR1() namespace std { namespace tr1 {
    #define CXXO_CLOSE_STDTR1() } }
    #if (defined(CXXOMFORT_NOTICES) && CXXOMFORT_NOTICES > 1)
		#pragma message CXXO_NOTICE ("namespace tr1")
	#endif
#else 
	#define CXXOFLAG_namespace_tr1 0
    #define CXXO_namespace_tr1 std
    #define CXXO_OPEN_STDTR1() namespace std { 
    #define CXXO_CLOSE_STDTR1() } 
#endif


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

// Macros to conditionally generate keywords

................................................................................
#else
	// a shot in the dark?
	#undef  CXXO_TYPEOF
	#define CXXO_TYPEOF(expr) cxxo_typeof_not_available_t 
#endif























































































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









#include "config/_codegen.hpp"
#include "config/_has.hpp"
#define _CXXOMFORT_IMPLEMENTS(nn) (( CXXO_JOIN(CXXOMFORT_IMPLEMENTS_n,nn) > 0))
#define CXXOMFORT_IMPLEMENTS(nn) _CXXOMFORT_IMPLEMENTS(nn)

// this command in a shell reveals all nxxxx proposals implemented by this library:
// find -type f -iname '*.hpp' | xargs egrep -o "CXXOMFORT_IMPLEMENTS_n([0-9]+)\b"

Added cxxomfort/cxxomfort/config/_codegen.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
#ifndef CXXOMFORT_CONFIG_HPP
    #error "This file should only be #included via <cxxomfort/config.hpp>"
#endif
#ifndef CXXOMFORT_CONFIG_CODEGEN_HPP
#define CXXOMFORT_CONFIG_CODEGEN_HPP
/**
 * @file
 * @brief Code generation macros and utilities.
 */


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

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

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


/**
 * @def CXXO_DELETED_COPY_CONSTRUCTOR
 * @ingroup cxxomfort-codegen
 * @brief Announces a deleted (unavailable) copy constructor.
 * */
#if (CXXOMFORT_CXX_STD>=2011 || CXXO_COMPILER_SUPPORT_default_delete)
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) Type (Type const&) = delete
    #define CXXO_DELETED_COPY_ASSIGN(Type) Type& operator= (Type const&) = delete
#else
    #define CXXO_DELETED_COPY_CONSTRUCTOR(Type) private: Type (Type const&);public: 
    #define CXXO_DELETED_COPY_ASSIGN(Type) private: Type& operator= (Type const&); public: 
#endif

/**
 * */
// uses macro CXXO_SIG_CONDITION, to be set at call site, 
// to create conditional template/function arguments for SFINAE
#if (CXXOMFORT_CXX_STD >= 2011)
    #define CXXO_ENABLEIF_TEMPLATE() \
    , typename = typename std::enable_if< CXXO_SIGCONDITION >::type 
    #define CXXO_ENABLEIF_FUNCTION() 
#else
    #define CXXO_ENABLEIF_TEMPLATE() 
    #define CXXO_ENABLEIF_FUNCTION() \
    , typename std::enable_if< CXXO_SIGCONDITION >::type * = nullptr 
    
#endif



#endif

Changes to cxxomfort/cxxomfort/config/_pre.hpp.

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
#define CXXO_STRINGIZE1(x) CXXO_STRINGIZE1_IMPL1(x)

#define CXXO_JOIN_IMPL2(x,y) x##y
#define CXXO_JOIN_IMPL1(x,y) CXXO_JOIN_IMPL2(x,y)
//! Joins tokens
#define CXXO_JOIN(x,y) CXXO_JOIN_IMPL1(x,y)




#define CXXOMFORT_ISODATE() \
( \
((__DATE__[7]-'0')*1000 + (__DATE__[8]-'0')*100 + (__DATE__[9]-'0')*10 + (__DATE__[10]-'0') ) * 10000UL \

+ ( \
 ((__DATE__[0]=='J' ? 1:0)) | \


 ((__DATE__[0]=='F' ? 2:0)) | \
 ((__DATE__[0]=='M' ? 3:0)) | \


 ((__DATE__[0]=='A' ? 4:0)) | \


 ((__DATE__[0]=='S' ? 9:0)) | \
 ((__DATE__[0]=='O' ? 10:0)) | \
 ((__DATE__[0]=='N' ? 11:0)) | \
 ((__DATE__[0]=='D' ? 12:0)) \
 ) * 100 \
+ (__DATE__[4]-'0')*10 + (__DATE__[5]-'0')\
)


#endif







>
>
>


<
>

|
>
>

|
>
>
|
>
>





|




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
#define CXXO_STRINGIZE1(x) CXXO_STRINGIZE1_IMPL1(x)

#define CXXO_JOIN_IMPL2(x,y) x##y
#define CXXO_JOIN_IMPL1(x,y) CXXO_JOIN_IMPL2(x,y)
//! Joins tokens
#define CXXO_JOIN(x,y) CXXO_JOIN_IMPL1(x,y)

#define CXXOMFORT_ISOYEAR() ((__DATE__[7]-'0')*1000 + (__DATE__[8]-'0')*100 + (__DATE__[9]-'0')*10 + (__DATE__[10]-'0') )
#define CXXOMFORT_ISOMONTH() 0
#define CXXOMFORT_ISODAY() (( __DATE__[4]==' ' ?  0 : __DATE__[4]-'0')*10 + (__DATE__[5]-'0'))
#define CXXOMFORT_ISODATE() \
( \

CXXOMFORT_ISOYEAR() * 10000UL \
+ ( \
 ((__DATE__[0]=='J' ? \
 (__DATE__[1]=='a' ? 1 : 6)\
 :0)) | \
 ((__DATE__[0]=='F' ? 2:0)) | \
 ((__DATE__[0]=='M' ? \
 (__DATE__[2]=='r' ? 3 : 5)\
 :0)) | \
 ((__DATE__[0]=='A' ? \
 (__DATE__[1]=='p' ? 4 : 8)\
 :0)) | \
 ((__DATE__[0]=='S' ? 9:0)) | \
 ((__DATE__[0]=='O' ? 10:0)) | \
 ((__DATE__[0]=='N' ? 11:0)) | \
 ((__DATE__[0]=='D' ? 12:0)) \
 ) * 100 \
+ CXXOMFORT_ISODAY() \
)


#endif

Changes to cxxomfort/cxxomfort/config/gcc.hpp.

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
..
97
98
99
100
101
102
103





104
105
106
107
108
109
110
    #define CXXO_WARNING(msg) CXXO_NOTICE_IMPL_( "cxxomfort warning: " msg)
#endif

#if defined(CXXOMFORT_NOTICES)
    #pragma message( CXXO_NOTICE("Found the GNU C++ Compiler."))
#endif

// GCC has a known bug where __cplusplus is not a YYYYMM tag in old versions in C++03 mode



#if (CXXOMFORT_COMPILER_VERSION == 406 && CXXOMFORT_CXX_STD<10)
	#undef  CXXOMFORT_CXX_STD
	#define CXXOMFORT_CXX_STD 1997
#endif

// GCC advertises C++11 mode with "-std=c++0x" and a macro
#if (CXXOMFORT_CXX_STD < 2011 && defined(__GXX_EXPERIMENTAL_CXX0X__))
    #undef  CXXOMFORT_CXX_EMULATION
    #define CXXOMFORT_CXX_EMULATION 2011
#endif


// detect tr1:: namespace / <tr1/> headers
#if (CXXOMFORT_CXX_STD < 2011 && CXXOMFORT_CXX_EMULATION < 2011)
	#if !defined(CXXOFLAG_namespace_tr1)
		#define CXXOFLAG_namespace_tr1 1
	#endif
#endif


/**
 * GCC headers tend to be organized via a 
 * path with subfolders {bits,tr1}
 */
#undef  CXXO_INCLUDE_SYS
#define CXXO_INCLUDE_SYS(name) <bits/../tr1/../name>
................................................................................
// 


#undef  CXXO_COMPILER_SUPPORT_typeof
#define CXXO_COMPILER_SUPPORT_typeof 1
#undef  CXXO_COMPILER_SUPPORT_va_args
#define CXXO_COMPILER_SUPPORT_va_args 1






// set up TR1 headers
#if (CXXOFLAG_namespace_tr1>0)
    #undef  CXXO_COMPILER_SUPPORT_tr1_cstdint
    #define CXXO_COMPILER_SUPPORT_tr1_cstdint 1
    #undef  CXXO_COMPILER_SUPPORT_tr1_random
    #define CXXO_COMPILER_SUPPORT_tr1_random 1







|
>
>
>
|











<
<
<
<
<
<
<







 







>
>
>
>
>







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
..
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
    #define CXXO_WARNING(msg) CXXO_NOTICE_IMPL_( "cxxomfort warning: " msg)
#endif

#if defined(CXXOMFORT_NOTICES)
    #pragma message( CXXO_NOTICE("Found the GNU C++ Compiler."))
#endif

/** GCC old versions define __cplusplus to be 1 but still have 
 * some good C++1997 and C++2003 support.
 * */
#if (CXXOMFORT_COMPILER_VERSION >= 400 && CXXOMFORT_COMPILER_VERSION <= 406 \
&& CXXOMFORT_CXX_STD<10)
	#undef  CXXOMFORT_CXX_STD
	#define CXXOMFORT_CXX_STD 1997
#endif

// GCC advertises C++11 mode with "-std=c++0x" and a macro
#if (CXXOMFORT_CXX_STD < 2011 && defined(__GXX_EXPERIMENTAL_CXX0X__))
    #undef  CXXOMFORT_CXX_EMULATION
    #define CXXOMFORT_CXX_EMULATION 2011
#endif










/**
 * GCC headers tend to be organized via a 
 * path with subfolders {bits,tr1}
 */
#undef  CXXO_INCLUDE_SYS
#define CXXO_INCLUDE_SYS(name) <bits/../tr1/../name>
................................................................................
// 


#undef  CXXO_COMPILER_SUPPORT_typeof
#define CXXO_COMPILER_SUPPORT_typeof 1
#undef  CXXO_COMPILER_SUPPORT_va_args
#define CXXO_COMPILER_SUPPORT_va_args 1

#if (CXXOMFORT_CXX_STD >= 1997 && CXXOMFORT_CXX_STD < 2011 && CXXOMFORT_CXX_EMULATION < 2011)
	#undef  CXXOFLAG_namespace_tr1 
	#define CXXOFLAG_namespace_tr1 1
#endif

// set up TR1 headers
#if (CXXOFLAG_namespace_tr1>0)
    #undef  CXXO_COMPILER_SUPPORT_tr1_cstdint
    #define CXXO_COMPILER_SUPPORT_tr1_cstdint 1
    #undef  CXXO_COMPILER_SUPPORT_tr1_random
    #define CXXO_COMPILER_SUPPORT_tr1_random 1

Changes to cxxomfort/cxxomfort/config/msc.hpp.

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
124
125
126
127
128
129
130
131

132
133
134
135
136
137
138
139
...
144
145
146
147
148
149
150





151
152
153
154
155
156
157
158
159
160
...
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#endif


// At least VC2005
#if (CXXOMFORT_COMPILER_VERSION > 1200)
#endif

// At least VC2008
#if (CXXOMFORT_COMPILER_VERSION >= 1500)
    #if (_MSC_FULL_VER == 150030729)
        #undef  CXXOMFORT_COMPILER_VERSION
        #define CXXOMFORT_COMPILER_VERSION 1501
    #endif
    #undef  CXXO_COMPILER_SUPPORT_compiler_intrinsics_is_x
    #define CXXO_COMPILER_SUPPORT_compiler_intrinsics_is_x 1
    #undef  CXXO_COMPILER_SUPPORT_va_args
................................................................................
    #undef  CXXO_COMPILER_SUPPORT_unique_ptr
    #define CXXO_COMPILER_SUPPORT_unique_ptr 1

    
#endif

// -- TODO -- get my claws on a MSVC 2012 / 2013 for actual testing
// At least VC2012

#if (CXXOMFORT_COMPILER_VERSION >= 1700) // VC12 or higher
    #undef  CXXO_COMPILER_SUPPORT_cstd_cstdint 
    #define CXXO_COMPILER_SUPPORT_cstd_cstdint 1
    #undef  CXXO_COMPILER_SUPPORT_cstd_typeindex
    #define CXXO_COMPILER_SUPPORT_cstd_typeindex 1
    #undef  CXXO_COMPILER_SUPPORT_common_type
    #define CXXO_COMPILER_SUPPORT_common_type 1
    #undef  CXXO_COMPILER_SUPPORT_enum_class
................................................................................
    #define CXXO_COMPILER_SUPPORT_std_common_type 1
    #undef  CXXO_COMPILER_SUPPORT_std_is_trivially
    #define CXXO_COMPILER_SUPPORT_std_is_trivially 1
    #undef  CXXO_COMPILER_SUPPORT_std_is_constructible_traits
    #define CXXO_COMPILER_SUPPORT_std_is_constructible_traits 1
#endif







// At least VC2015
#if (CXXOMFORT_COMPILER_VERSION >= 1900) // VC 2015 or higher
    #undef  CXXO_COMPILER_SUPPORT_alignment_tools
    #define CXXO_COMPILER_SUPPORT_alignment_tools 1
    #undef  CXXO_COMPILER_SUPPORT_alignof 
    #define CXXO_COMPILER_SUPPORT_alignof 1
    #undef  CXXO_COMPILER_SUPPORT_attribute
    #define CXXO_COMPILER_SUPPORT_attribute 1
    #undef  CXXO_COMPILER_SUPPORT_constexpr
................................................................................
    #undef  CXXO_COMPILER_SUPPORT_user_defined_literals
    #define CXXO_COMPILER_SUPPORT_user_defined_literals 1
    #undef  CXXO_COMPILER_SUPPORT_variadic
    #define CXXO_COMPILER_SUPPORT_variadic 1

#endif

#if (0 && CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,>= 1600) && CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC, < 1700))
    #undef  CXXO_COMPILER_SUPPORT_cstd_system_error
    #define CXXO_COMPILER_SUPPORT_cstd_system_error 0
#endif // <system_error>


// -- END Microsoft C++ Compiler --
#endif







|
|







 







|
>
|







 







>
>
>
>
>


|







 







<
<
<
<
<



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
...
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
...
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
...
176
177
178
179
180
181
182





183
184
185
#endif


// At least VC2005
#if (CXXOMFORT_COMPILER_VERSION > 1200)
#endif


#if (CXXOMFORT_COMPILER_VERSION >= 1500) // VC 2008 or higher
    #if (_MSC_FULL_VER == 150030729)
        #undef  CXXOMFORT_COMPILER_VERSION
        #define CXXOMFORT_COMPILER_VERSION 1501
    #endif
    #undef  CXXO_COMPILER_SUPPORT_compiler_intrinsics_is_x
    #define CXXO_COMPILER_SUPPORT_compiler_intrinsics_is_x 1
    #undef  CXXO_COMPILER_SUPPORT_va_args
................................................................................
    #undef  CXXO_COMPILER_SUPPORT_unique_ptr
    #define CXXO_COMPILER_SUPPORT_unique_ptr 1

    
#endif

// -- TODO -- get my claws on a MSVC 2012 / 2013 for actual testing
// -- NEW TODO -- get my claws on the MSVC 2013 and CRTP.

#if (CXXOMFORT_COMPILER_VERSION >= 1700) // At least VC 2012
    #undef  CXXO_COMPILER_SUPPORT_cstd_cstdint 
    #define CXXO_COMPILER_SUPPORT_cstd_cstdint 1
    #undef  CXXO_COMPILER_SUPPORT_cstd_typeindex
    #define CXXO_COMPILER_SUPPORT_cstd_typeindex 1
    #undef  CXXO_COMPILER_SUPPORT_common_type
    #define CXXO_COMPILER_SUPPORT_common_type 1
    #undef  CXXO_COMPILER_SUPPORT_enum_class
................................................................................
    #define CXXO_COMPILER_SUPPORT_std_common_type 1
    #undef  CXXO_COMPILER_SUPPORT_std_is_trivially
    #define CXXO_COMPILER_SUPPORT_std_is_trivially 1
    #undef  CXXO_COMPILER_SUPPORT_std_is_constructible_traits
    #define CXXO_COMPILER_SUPPORT_std_is_constructible_traits 1
#endif

// At least VC2013
#if (CXXOMFORT_COMPILER_VERSION >= 1800) // At least VC 2012
	#undef  CXXO_COMPILER_SUPPORT_functional_transparent
	#define CXXO_COMPILER_SUPPORT_functional_transparent 1
#endif

// At least VC2015
#if (CXXOMFORT_COMPILER_VERSION >= 1900) // At least VC 2015
    #undef  CXXO_COMPILER_SUPPORT_alignment_tools
    #define CXXO_COMPILER_SUPPORT_alignment_tools 1
    #undef  CXXO_COMPILER_SUPPORT_alignof 
    #define CXXO_COMPILER_SUPPORT_alignof 1
    #undef  CXXO_COMPILER_SUPPORT_attribute
    #define CXXO_COMPILER_SUPPORT_attribute 1
    #undef  CXXO_COMPILER_SUPPORT_constexpr
................................................................................
    #undef  CXXO_COMPILER_SUPPORT_user_defined_literals
    #define CXXO_COMPILER_SUPPORT_user_defined_literals 1
    #undef  CXXO_COMPILER_SUPPORT_variadic
    #define CXXO_COMPILER_SUPPORT_variadic 1

#endif







// -- END Microsoft C++ Compiler --
#endif

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

63
64
65
66
67
68
69
70
71
72
73
74
75


76
77

// integer types are available in native cstdint

// explicit cast... do templates work?

#endif // 9999

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

#endif




#endif







|





>
>


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

// integer types are available in native cstdint

// explicit cast... do templates work?

#endif // 9999

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

#endif

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

#endif

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

3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132

133
/**
 * @file
 * 
 * This file is intended to be included only in circumstances where 
 * cxxomfort detects there is not an <array> or <tr1/array> available 
 * (detection which has yet to be implemented via CXXOFLAG_NO_TR1 )
 */
#include "./base.hpp"

#include CXXO_INCLUDE_SYS(iterator)
#include CXXO_INCLUDE_SYS(algorithm)
#include <cxxomfort/impl/relationals.hpp>
#define CXXOMFORT_IMPLEMENTS_n1479 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_std_array CXXOMFORT_IMPLEMENTS_n1479

namespace cxxomfort {
namespace cxxostd {
namespace array {

................................................................................
    return a[I];
}


} // array
} }

#if (CXXOMFORT_CXX_STD < 2011 && defined(CXXOMFORT_NO_TR1))
namespace std { namespace tr1 {
    using cxxomfort::cxxostd::array::array;
    using cxxomfort::cxxostd::array::get;
}}
#endif


#endif







|
>


<







 







<
<
<
<
<
<

>

3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
...
119
120
121
122
123
124
125






126
127
128
/**
 * @file
 * 
 * This file is intended to be included only in circumstances where 
 * cxxomfort detects there is not an <array> or <tr1/array> available 
 * (detection which has yet to be implemented via CXXOFLAG_NO_TR1 )
 */
#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 {

................................................................................
    return a[I];
}


} // array
} }









#endif

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

7
8
9
10
11
12
13

14
15
16
17
18
19
20
/**
 * @file 
 * @brief Implementation of std::decay
 */

#include <cxxomfort/config.hpp>
#include <cxxomfort/type_traits.hpp> // remove_reference etc


// obtained directly from cppreference.

namespace cxxomfort { namespace cxxostd {

template< typename T >
struct decay {







>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**
 * @file 
 * @brief Implementation of std::decay
 */

#include <cxxomfort/config.hpp>
#include <cxxomfort/type_traits.hpp> // remove_reference etc
#include "./using_tr1_type_traits.hpp"

// obtained directly from cppreference.

namespace cxxomfort { namespace cxxostd {

template< typename T >
struct decay {

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

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
...
266
267
268
269
270
271
272






































































273
274
275
276
277
278
279


template <typename Numeric> std::string stringexpr (Numeric t) {
    using namespace std;
    static_assert ( ::cxxomfort::traits::is_arithmetic<Numeric>::value, "to_string requires a numeric type.");
    //cout<< "Type: "<< typeid(Numeric).name()<< flush;
    char buf [ printfmask<Numeric>::len ] = {'\0'};
    int srv = ::sprintf(buf, printfmask<Numeric>::mask(), t);
    if (srv < 0) return "";
    else return std::string(buf);
}

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


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

    string_to_integral (std::string const& str, size_t *pinv, int base)
    : _s(str), _p(pinv), _b(base), _pfn( fn_s_to_i<Integral>::fn() ) {
    }
    
    operator Integral () const {
        using namespace std;
        Integral ret= 0;
        // we do here the job of conversion. 
        if (_s.empty()) throw invalid_argument("string2integral: empty string to convert to integral");
        vector<char> vstr (_s.begin(), _s.end());
        vstr.push_back('\0');
        char *eipos;
        char *b= &(vstr[0]);
        //char *e= b + vstr.size();
        ret = _pfn( b, &eipos, _b);
        int err= errno;
        const std::string throwmsg= std::string("string2integral: conversion of string \"") + _s + "\" to integral";
        if (err==ERANGE) throw out_of_range( throwmsg );
        else if (err==EINVAL || eipos==b) throw invalid_argument( "string2integral: invalid argument in call to");
        if (_p) *_p = static_cast<size_t>(eipos - b);
        return ret;
    }

    private:
    std::string const& _s;
    string_to_integral& operator= (string_to_integral const&);

    size_t* _p;
    const int _b;
    convertfn _pfn;
};


} //cxxomfort::cxxostd::detail_string


/**
 * @fn to_string(int)
 * @brief Converts an integral variable into a @c std::string .
................................................................................

std::wstring to_wstring (int i) {
    return detail::stringexpr(i);
}
*/








































































/**
 * @brief Converts a @c string expression to a <code>unsigned long</code>.
 * @param base Base to convert from, which can be 2, 8, 10 (default) or 16.
 * @xrefitem std0string "<string>" "Conversions"
 **/
static inline unsigned long       stoul (std::string const& str, size_t* pinv, int base=10) {
    return detail_string::string_to_integral<unsigned long>(str,pinv,base);







|



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







 







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







132
133
134
135
136
137
138
139
140
141
142































































143
144
145
146
147
148
149
...
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286


template <typename Numeric> std::string stringexpr (Numeric t) {
    using namespace std;
    static_assert ( ::cxxomfort::traits::is_arithmetic<Numeric>::value, "to_string requires a numeric type.");
    //cout<< "Type: "<< typeid(Numeric).name()<< flush;
    char buf [ printfmask<Numeric>::len ] = {'\0'};
    int srv = sprintf(buf, printfmask<Numeric>::mask(), t);
    if (srv < 0) return "";
    else return std::string(buf);
}
































































} //cxxomfort::cxxostd::detail_string


/**
 * @fn to_string(int)
 * @brief Converts an integral variable into a @c std::string .
................................................................................

std::wstring to_wstring (int i) {
    return detail::stringexpr(i);
}
*/




namespace detail_string {



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


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

    string_to_integral (std::string const& str, size_t *pinv, int base)
    : _s(str), _p(pinv), _b(base), _pfn( fn_s_to_i<Integral>::fn() ) {
    }
    
    operator Integral () const {
        using namespace std;
        Integral ret= 0;
        // we do here the job of conversion. 
        if (_s.empty()) throw invalid_argument("string2integral: empty string to convert to integral");
        vector<char> vstr (_s.begin(), _s.end());
        vstr.push_back('\0');
        char *eipos;
        char *b= &(vstr[0]);
        //char *e= b + vstr.size();
        ret = _pfn( b, &eipos, _b);
        int err= errno;
        const std::string throwmsg= std::string("string2integral: conversion of string \"") + _s + "\" to integral";
        if (err==ERANGE) throw out_of_range( throwmsg );
        else if (err==EINVAL || eipos==b) throw invalid_argument( "string2integral: invalid argument in call to");
        if (_p) *_p = static_cast<size_t>(eipos - b);
        return ret;
    }

    private:
    std::string const& _s;
    string_to_integral& operator= (string_to_integral const&);

    size_t* _p;
    const int _b;
    convertfn _pfn;
};

} // detail_string::

/**
 * @brief Converts a @c string expression to a <code>unsigned long</code>.
 * @param base Base to convert from, which can be 2, 8, 10 (default) or 16.
 * @xrefitem std0string "<string>" "Conversions"
 **/
static inline unsigned long       stoul (std::string const& str, size_t* pinv, int base=10) {
    return detail_string::string_to_integral<unsigned long>(str,pinv,base);

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

13
14
15
16
17
18
19
20
21
22
23

24
25
26
27
28
29
30
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 * Interfaces defined in this header:
 * 
 * 
 */

#include <cxxomfort/base.hpp>
#include <typeinfo>
#include <functional> // std::hash
#include <string> // for debug of hash_code
#include <cxxomfort/impl/relationals.hpp>
//#include <cxxomfort/using.hpp> // std::tr1::hash


namespace cxxomfort { namespace cxxostd { 

static inline size_t ty_id () {
    static size_t i= 0;
    return i++;
}
................................................................................
    size_t       hash_code () const CXXO_NOEXCEPT { 
#if (CXXOMFORT_CXX_STD >= 2011)
        return TR->hash_code(); 
#else
        // in C++03 there's no type_info::hash_code
        // we go to hash<const char*>
        using namespace std;
        hash<char const*> const H;
        return H( TR->name() );
#endif
    }
    
    friend bool     operator== (type_index const& l, type_index const& r) CXXO_NOEXCEPTNOTHROW {
        return l.TR==r.TR;
    }
    friend bool     operator<  (type_index const& l, type_index const& r) CXXO_NOEXCEPTNOTHROW {







|
<

<
>







 







|
|







13
14
15
16
17
18
19
20

21

22
23
24
25
26
27
28
29
..
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
 * Interfaces defined in this header:
 * 
 * 
 */

#include <cxxomfort/base.hpp>
#include <typeinfo>
#include <cxxomfort/functional.hpp> // std::hash

#include <cxxomfort/impl/relationals.hpp>

//#include <string> // for debug of hash_code

namespace cxxomfort { namespace cxxostd { 

static inline size_t ty_id () {
    static size_t i= 0;
    return i++;
}
................................................................................
    size_t       hash_code () const CXXO_NOEXCEPT { 
#if (CXXOMFORT_CXX_STD >= 2011)
        return TR->hash_code(); 
#else
        // in C++03 there's no type_info::hash_code
        // we go to hash<const char*>
        using namespace std;
        //hash<char const*> const H ();
        return hash<char const*>()( TR->name() );
#endif
    }
    
    friend bool     operator== (type_index const& l, type_index const& r) CXXO_NOEXCEPTNOTHROW {
        return l.TR==r.TR;
    }
    friend bool     operator<  (type_index const& l, type_index const& r) CXXO_NOEXCEPTNOTHROW {

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

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
#ifndef CXXOMFORT_IMPL_ALGORITHM_14EQUAL_HPP
#define CXXOMFORT_IMPL_ALGORITHM_14EQUAL_HPP
/**
 * @file
 * @brief Implementation of C++14's overloads for @c equal(), @c mismatch() .
 * */
#include <cxxomfort/base.hpp>
#include <type_traits>
#include "../algorithm.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 {







<

>







1
2
3
4
5
6
7

8
9
10
11
12
13
14
15
16
#ifndef CXXOMFORT_IMPL_ALGORITHM_14EQUAL_HPP
#define CXXOMFORT_IMPL_ALGORITHM_14EQUAL_HPP
/**
 * @file
 * @brief Implementation of C++14's overloads for @c equal(), @c mismatch() .
 * */
#include <cxxomfort/base.hpp>

#include "../algorithm.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 {

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

18
19
20
21
22
23
24


25
26
27
28
29
30
31
...
185
186
187
188
189
190
191
192

193
194
195
196
197
198
199
 * * @c std::bit_or<void>
 * * @c std::bit_xor<void>
 *
 */


#include <cxxomfort/config.hpp>


#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors CXXOMFORT_IMPLEMENTS_n3421


#include CXXO_INCLUDE_SYS(functional)
// <functional> needs to be #included for this to make any sense
#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
................................................................................
// 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)

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.







>
>







 







|
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 * * @c std::bit_or<void>
 * * @c std::bit_xor<void>
 *
 */


#include <cxxomfort/config.hpp>


#define CXXOMFORT_IMPLEMENTS_n3421 CXXO_IMPLSTATUS_BACKPORT()
#define CXXOMFORT_IMPLEMENTS_heterogeneous_operator_functors CXXOMFORT_IMPLEMENTS_n3421


#include CXXO_INCLUDE_SYS(functional)
// <functional> needs to be #included for this to make any sense
#if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
................................................................................
// 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.

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

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
..
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
 * byte << integer, byte >> integer
 * 
 * byte byte(char) <-- explicit
 * 
 */


#if (CXXOMFORT_CXX_STD < 2017)


    #define CXXOMFORT_USING_stdbyte
#else     
    #define CXXOMFORT_IMPLEMENTS_byte 0
    #define CXXOMFORT_IMPLEMENTS_p0298r3 0
#endif

// -----
// implementation
//

#if (defined(CXXOMFORT_USING_stdbyte))
namespace cxxomfort { namespace cxxostd {

    #if (CXXOMFORT_CXX_STD >= 2011)
        #define CXXOMFORT_IMPLEMENTS_p0298r2 CXXO_IMPLSTATUS_BACKPORT()
        #define CXXOMFORT_IMPLEMENTS_p0298r3 CXXOMFORT_IMPLEMENTS_p0298r2
        #define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3

        
enum class byte : unsigned char {};


template <typename Int, typename = typename std::enable_if< std::is_integral<Int>::value>::type >
constexpr inline Int to_integer (byte b) noexcept { 
................................................................................

template <typename Int, typename = typename std::enable_if< std::is_integral<Int>::value>::type >
constexpr static inline byte to_byte (Int i) noexcept {
    return static_cast<byte>(i);
}
        
    #else
        #define CXXOMFORT_IMPLEMENTS_p0298r2 CXXO_IMPLSTATUS_EMULATION()
        #define CXXOMFORT_IMPLEMENTS_p0298r3 CXXOMFORT_IMPLEMENTS_p0298r2
        #define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3
        // these three go here to ensure that we call namespace std outside
        }}
        #include "./typesafe_enum-core.hpp"
        namespace cxxomfort { namespace cxxostd {

namespace detail { // detail








|
>
>

<












|
|
|







 







|
|
|







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
..
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 * byte << integer, byte >> integer
 * 
 * byte byte(char) <-- explicit
 * 
 */


#if (CXXOMFORT_CXX_STD>=2017)

#elif (CXXOMFORT_CXX_STD>=1997)
    #define CXXOMFORT_USING_stdbyte

    #define CXXOMFORT_IMPLEMENTS_byte 0
    #define CXXOMFORT_IMPLEMENTS_p0298r3 0
#endif

// -----
// implementation
//

#if (defined(CXXOMFORT_USING_stdbyte))
namespace cxxomfort { namespace cxxostd {

    #if (CXXOMFORT_CXX_STD >= 2011)
        //#define CXXOMFORT_IMPLEMENTS_p0298r2 CXXO_IMPLSTATUS_BACKPORT()
        //#define CXXOMFORT_IMPLEMENTS_p0298r3 CXXOMFORT_IMPLEMENTS_p0298r2
        //#define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3

        
enum class byte : unsigned char {};


template <typename Int, typename = typename std::enable_if< std::is_integral<Int>::value>::type >
constexpr inline Int to_integer (byte b) noexcept { 
................................................................................

template <typename Int, typename = typename std::enable_if< std::is_integral<Int>::value>::type >
constexpr static inline byte to_byte (Int i) noexcept {
    return static_cast<byte>(i);
}
        
    #else
        //#define CXXOMFORT_IMPLEMENTS_p0298r2 CXXO_IMPLSTATUS_EMULATION()
        //#define CXXOMFORT_IMPLEMENTS_p0298r3 CXXOMFORT_IMPLEMENTS_p0298r2
        //#define CXXOMFORT_IMPLEMENTS_byte CXXOMFORT_IMPLEMENTS_p0298r3
        // these three go here to ensure that we call namespace std outside
        }}
        #include "./typesafe_enum-core.hpp"
        namespace cxxomfort { namespace cxxostd {

namespace detail { // detail

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

3
4
5
6
7
8
9

10
11
12
13
14
15
16
..
66
67
68
69
70
71
72

73
74
75
76

77
78
79
80
81
82
83
...
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
/**
 * @file
 * @brief Implementation for std::string_view and allies
 *
 */

#include <cstring>

#include <algorithm>
#include <cxxomfort/impl/n3334-array_ref.hpp>
#include <cxxomfort/util/type_traits.hpp>
#include <cxxomfort/impl/relationals.hpp>
#include <ostream>

#define CXXOMFORT_IMPLEMENTS_n3605 CXXO_IMPLSTATUS_BACKPORT()
................................................................................
    
    //! String view to a buffer of characters at position @e px to be processed via character_traits.
    CXXO_CONSTEXPR basic_string_view (pointer px) CXXO_NOEXCEPTNOTHROW 
    : membertype(px, CTraits::length(px) )
    {}

    //! String view to an array of characters.

    template<size_t N>
    CXXO_CONSTEXPR basic_string_view (CharT const(&arr)[N])
    : membertype(arr,N)
    {}


    using membertype::max_size;
    using membertype::size;
    using membertype::empty;
    using membertype::data;
    //! Returns the length of the viewed string.
    CXXO_CONSTEXPR 
................................................................................
#define TARGS Ch,ChT
CXXO_GENERATE_RELATIONALS_T(basic_string_view);
#undef TARGS
#undef TPARAMS


//! Name for a strng view of @c char .
typedef basic_string_view<char> string_view;
//! Name for a string view of @c wchar_t .
typedef basic_string_view<wchar_t> wstring_view;
#if (CXXOMFORT_CXX_STD >= 2011)
typedef basic_string_view<char16_t> u16string_view;
typedef basic_string_view<char32_t> u32string_view;
#endif




/**
 * Outputs the given string to a C++ output stream.
 * */
template <class Ch, class ChTraits>




std::basic_ostream<Ch, ChTraits>&
operator<<  (std::basic_ostream<Ch, ChTraits>& os, basic_string_view<Ch, ChTraits> v) {
    using namespace std;
    //size_t const n= max(static_cast<size_t>(os.width()), v.size());
    //os.rdbuf()->sputn(v.data(), n);
    for (size_t i= 0; i < v.size(); ++i) { os<< v[i]; }
    os.width(0);
    return os;
}


               







               
} }



#endif







>







 







>




>







 







|

|





>
>




|
>
>
>
>










>
|
>
>
>
>
>
>
>
|
<

>
>

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
..
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
...
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266

267
268
269
270
/**
 * @file
 * @brief Implementation for std::string_view and allies
 *
 */

#include <cstring>
#include <stdexcept>
#include <algorithm>
#include <cxxomfort/impl/n3334-array_ref.hpp>
#include <cxxomfort/util/type_traits.hpp>
#include <cxxomfort/impl/relationals.hpp>
#include <ostream>

#define CXXOMFORT_IMPLEMENTS_n3605 CXXO_IMPLSTATUS_BACKPORT()
................................................................................
    
    //! String view to a buffer of characters at position @e px to be processed via character_traits.
    CXXO_CONSTEXPR basic_string_view (pointer px) CXXO_NOEXCEPTNOTHROW 
    : membertype(px, CTraits::length(px) )
    {}

    //! String view to an array of characters.
#if (CXXOMFORT_CXX_STD>=1997)
    template<size_t N>
    CXXO_CONSTEXPR basic_string_view (CharT const(&arr)[N])
    : membertype(arr,N)
    {}
#endif

    using membertype::max_size;
    using membertype::size;
    using membertype::empty;
    using membertype::data;
    //! Returns the length of the viewed string.
    CXXO_CONSTEXPR 
................................................................................
#define TARGS Ch,ChT
CXXO_GENERATE_RELATIONALS_T(basic_string_view);
#undef TARGS
#undef TPARAMS


//! Name for a strng view of @c char .
typedef basic_string_view<char, std::char_traits<char> > string_view;
//! Name for a string view of @c wchar_t .
typedef basic_string_view<wchar_t, std::char_traits<wchar_t> > wstring_view;
#if (CXXOMFORT_CXX_STD >= 2011)
typedef basic_string_view<char16_t> u16string_view;
typedef basic_string_view<char32_t> u32string_view;
#endif

} }


/**
 * Outputs the given string to a C++ output stream.
 * */
#if (CXXOMFORT_CXX_STD>=1997)

namespace cxxomfort { namespace cxxostd {

template <typename Ch, typename ChTraits>
std::basic_ostream<Ch, ChTraits>&
operator<<  (std::basic_ostream<Ch, ChTraits>& os, basic_string_view<Ch, ChTraits> v) {
    using namespace std;
    //size_t const n= max(static_cast<size_t>(os.width()), v.size());
    //os.rdbuf()->sputn(v.data(), n);
    for (size_t i= 0; i < v.size(); ++i) { os<< v[i]; }
    os.width(0);
    return os;
}

} }

#else
std::ostream& 
operator<< (std::ostream& os, cxxomfort::cxxostd::string_view v) {
    using namespace std;
    for (size_t i= 0; i < v.size(); ++i) { os<< v[i]; }
    os.width(0);
    return os;
}


#endif // 1997 for operator<<

#endif

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

1
2
3


4
5
6
7
8
9
10
...
235
236
237
238
239
240
241





242
#ifndef CXXOMFORT_IMPL_FUNCTIONMETA_HPP
#define CXXOMFORT_IMPL_FUNCTIONMETA_HPP



/**
 * @file
 * @brief Meta information for function types.
 * 
 * Interfaces defined in this file:
 * 
 * * @c functiontype - traits for properties about function signatures (return type, arity, etc).
................................................................................
};
#endif



} }






#endif



>
>







 







>
>
>
>
>

1
2
3
4
5
6
7
8
9
10
11
12
...
237
238
239
240
241
242
243
244
245
246
247
248
249
#ifndef CXXOMFORT_IMPL_FUNCTIONMETA_HPP
#define CXXOMFORT_IMPL_FUNCTIONMETA_HPP

#if (CXXOMFORT_CXX_STD >= 1997)

/**
 * @file
 * @brief Meta information for function types.
 * 
 * Interfaces defined in this file:
 * 
 * * @c functiontype - traits for properties about function signatures (return type, arity, etc).
................................................................................
};
#endif



} }

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

#endif

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

73
74
75
76
77
78
79


80
81
82
83
84
85










86
87
88
89
90
91
92
...
144
145
146
147
148
149
150

151
152

153
154
155
156
157
158
159
...
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
 * 
 */
template <typename T>
class array_ref {
    public:
    //! Type of the data contained in the view.
    typedef T       value_type;


    //! Type of a pointer to a contained value; potentially writable.
    typedef typename ct::compose<T,::std::add_pointer>::type   pointer;
    //! Type of a pointer to a contained value; view-only.
    typedef typename ct::compose<T,::std::add_const, ::std::add_pointer>::type const_pointer;
    typedef typename ct::compose<T,std::add_lvalue_reference>::type   reference;
    typedef typename ct::compose<T,std::add_const,std::add_lvalue_reference>::type const_reference;










    //! Type for the distance between pointers or iterators.
    typedef ptrdiff_t    difference_type;
    //! Type for subscript / indexed access (eg.: <code>operator[]</code>).
    typedef size_t       size_type;
    //! Iterator type; potentially writable.
    typedef pointer           iterator;
    //! Iterator type; view-only.
................................................................................
    
    // access to elements

    // nonconst should only be enabled if T is nonconst
    reference       at (size_t i) { check_range(i); return ptr_[i]; }
    //! Checked access to i-th element; throws if the index is out of range.
    const_reference at (size_t i) const { check_range(i); return ptr_[i]; }

    //! Checked access to i-th element; sets up an @c error_code if the index is out of range.
    const_reference at (size_t i, std::error_code& ec) const { check_range(i,ec); return ptr_[i]; }

    //! Unchecked(!) access to the i-th element.
    CXXO_CONSTEXPR14
    reference       operator[] (size_t i) CXXO_NOEXCEPTNOTHROW { return ptr_[i]; }
    //! Unchecked(!) access to the i-th element.
    CXXO_CONSTEXPR 
    const_reference operator[] (size_t i) const CXXO_NOEXCEPTNOTHROW { return ptr_[i]; }
    
................................................................................
    //! Returns a view to the rightmost (last) @a n elements.
    array_ref       rightmost (size_type n) const CXXO_NOEXCEPTNOTHROW;
    //! Returns a view of sub-contents from position @a pos which can be negative, ala PHP, JS.
    array_ref       slice (difference_type pos, size_type count) const;
    //! @overload slice 
    array_ref       slice (difference_type pos) const;
    

    template <typename U>
    U          copy_to () const {
        return U(data(), size());
    }
    

    //! Returns a view with the last element removed.
    array_ref  without_back () const;
    //! Returns a view with the first element removed.
    array_ref  without_front () const;
    //! Removes the last @a n elements.
    array_ref  without_back_n (size_type n) const;
................................................................................
    //! Removes the first @a n elements.
    array_ref  without_front_n (size_type n) const;

    private:
    CXXO_CONSTEXPR14 void check_range (size_t i) const {
        if (i>=len_) throw std::out_of_range("array_ref: out of range");
    }

    void check_range (size_t i, std::error_code& ec) const {
        if (i>=len_) ec= std::make_error_code(cxxomfort::fix::errc::invalid_argument /*, std::generic_category() */);
    }

    
    pointer    ptr_;
    size_t     len_ CXXOMFORT_CXX11_CODE(= 0, ;);

}; // array_ref









>
>






>
>
>
>
>
>
>
>
>
>







 







>


>







 







>




|







 







>



>







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
...
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
...
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
...
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
 * 
 */
template <typename T>
class array_ref {
    public:
    //! Type of the data contained in the view.
    typedef T       value_type;

#if (CXXOMFORT_CXX_STD>=1997)    
    //! Type of a pointer to a contained value; potentially writable.
    typedef typename ct::compose<T,::std::add_pointer>::type   pointer;
    //! Type of a pointer to a contained value; view-only.
    typedef typename ct::compose<T,::std::add_const, ::std::add_pointer>::type const_pointer;
    typedef typename ct::compose<T,std::add_lvalue_reference>::type   reference;
    typedef typename ct::compose<T,std::add_const,std::add_lvalue_reference>::type const_reference;
#else
	private:
	typedef typename std::add_const<T>::type const_type;
	public:
	typedef typename std::add_pointer<T>::type pointer;
	typedef typename std::add_pointer<const_type>::type const_pointer;
	typedef T&  reference;
	typedef const_type&  const_reference;
#endif

    //! Type for the distance between pointers or iterators.
    typedef ptrdiff_t    difference_type;
    //! Type for subscript / indexed access (eg.: <code>operator[]</code>).
    typedef size_t       size_type;
    //! Iterator type; potentially writable.
    typedef pointer           iterator;
    //! Iterator type; view-only.
................................................................................
    
    // access to elements

    // nonconst should only be enabled if T is nonconst
    reference       at (size_t i) { check_range(i); return ptr_[i]; }
    //! Checked access to i-th element; throws if the index is out of range.
    const_reference at (size_t i) const { check_range(i); return ptr_[i]; }
#if (CXXOMFORT_CXX_STD>=1997)
    //! Checked access to i-th element; sets up an @c error_code if the index is out of range.
    const_reference at (size_t i, std::error_code& ec) const { check_range(i,ec); return ptr_[i]; }
#endif
    //! Unchecked(!) access to the i-th element.
    CXXO_CONSTEXPR14
    reference       operator[] (size_t i) CXXO_NOEXCEPTNOTHROW { return ptr_[i]; }
    //! Unchecked(!) access to the i-th element.
    CXXO_CONSTEXPR 
    const_reference operator[] (size_t i) const CXXO_NOEXCEPTNOTHROW { return ptr_[i]; }
    
................................................................................
    //! Returns a view to the rightmost (last) @a n elements.
    array_ref       rightmost (size_type n) const CXXO_NOEXCEPTNOTHROW;
    //! Returns a view of sub-contents from position @a pos which can be negative, ala PHP, JS.
    array_ref       slice (difference_type pos, size_type count) const;
    //! @overload slice 
    array_ref       slice (difference_type pos) const;
    
#if (CXXOMFORT_CXX_STD>=2011)
    template <typename U>
    U          copy_to () const {
        return U(data(), size());
    }
#endif    

    //! Returns a view with the last element removed.
    array_ref  without_back () const;
    //! Returns a view with the first element removed.
    array_ref  without_front () const;
    //! Removes the last @a n elements.
    array_ref  without_back_n (size_type n) const;
................................................................................
    //! Removes the first @a n elements.
    array_ref  without_front_n (size_type n) const;

    private:
    CXXO_CONSTEXPR14 void check_range (size_t i) const {
        if (i>=len_) throw std::out_of_range("array_ref: out of range");
    }
#if (CXXOMFORT_CXX_STD>=1997)
    void check_range (size_t i, std::error_code& ec) const {
        if (i>=len_) ec= std::make_error_code(cxxomfort::fix::errc::invalid_argument /*, std::generic_category() */);
    }
#endif
    
    pointer    ptr_;
    size_t     len_ CXXOMFORT_CXX11_CODE(= 0, ;);

}; // array_ref


Changes to cxxomfort/cxxomfort/impl/to_basic_string_variadic.hpp.

78
79
80
81
82
83
84
85
86


87
88
89
90
91
92
93
    return to_basic_string<wchar_t>
    (forward<Args>(args)...);
}

} // string
} } // cxxomfort::impl

#else
#include "to_basic_string_cxx03.hpp"


#endif

#if defined(DOXYGEN_DOC)

/**
 * @brief Provides a string expression of its arguments.
 * @ingroup independent-utilities







|

>
>







78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    return to_basic_string<wchar_t>
    (forward<Args>(args)...);
}

} // string
} } // cxxomfort::impl

#elif (CXXOMFORT_CXX_STD>=1997)
#include "to_basic_string_cxx03.hpp"
#else
	// unsupported
#endif

#if defined(DOXYGEN_DOC)

/**
 * @brief Provides a string expression of its arguments.
 * @ingroup independent-utilities

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

7
8
9
10
11
12
13


14
15
16
17
18
19
20
...
158
159
160
161
162
163
164




165
166
167
168
169
170
171
#include <iterator>
#include <utility>
/**
 * @file 
 * @ingroup cxxo-sup-functional
 * 
 * */



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

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


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

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

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





#endif

/**
 * @page cxxo-sup-functional
 * @brief Supplements to <functional>.
 * 
 * This section offers a number of alternatives and supplements to features found in 







>
>







 







>
>
>
>







7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#include <iterator>
#include <utility>
/**
 * @file 
 * @ingroup cxxo-sup-functional
 * 
 * */

#if (CXXOMFORT_CXX_STD>=1997)

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

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


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

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

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

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

#endif

/**
 * @page cxxo-sup-functional
 * @brief Supplements to <functional>.
 * 
 * This section offers a number of alternatives and supplements to features found in 

Changes to cxxomfort/cxxomfort/library/numeric.hpp.

6
7
8
9
10
11
12

13
14
15
16
17
18
19
...
227
228
229
230
231
232
233




234
235
236
237
238
239
240
#include <iterator>

/**
 * @file cxxomfort/library/numeric.hpp
 * 
 */



#include "../impl/to_signed.hpp"

namespace cxxomfort { namespace library {
namespace numeric {

using cxxomfort::impl::numeric::to_signed;
................................................................................

} // numeric::
} // library::
}







#endif

/**
 * @page cxxo-sup-numeric
 * @brief cxxomfort Supplementals for <numeric>
 * 
 * @code







>







 







>
>
>
>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
#include <iterator>

/**
 * @file cxxomfort/library/numeric.hpp
 * 
 */

#if (CXXOMFORT_CXX_STD>=1997)

#include "../impl/to_signed.hpp"

namespace cxxomfort { namespace library {
namespace numeric {

using cxxomfort::impl::numeric::to_signed;
................................................................................

} // numeric::
} // library::
}



#else
	// unsupported
#endif // CXX_STD

#endif

/**
 * @page cxxo-sup-numeric
 * @brief cxxomfort Supplementals for <numeric>
 * 
 * @code

Changes to cxxomfort/cxxomfort/library/sequences.hpp.

270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
 * 3b.- iterator has random_access_iterator_tag AND sequence has a .data member that returns pointer
 * 4.- the type is registered with register_contiguous_sequence
 * 
 * */

namespace {

template <typename S, typename = void>
struct contiguous_helper {
    typedef typename S::iterator I;
    typedef typename S::value_type V;
    typedef typename std::add_pointer<V>::type P;
    enum { clause1 = is_sequence<S>::value };
    enum { clause2 = is_sequence<S>::value };
    enum { clause3a = std::is_same< I, P >::value };







|







270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
 * 3b.- iterator has random_access_iterator_tag AND sequence has a .data member that returns pointer
 * 4.- the type is registered with register_contiguous_sequence
 * 
 * */

namespace {

template <typename S, typename IfS= void>
struct contiguous_helper {
    typedef typename S::iterator I;
    typedef typename S::value_type V;
    typedef typename std::add_pointer<V>::type P;
    enum { clause1 = is_sequence<S>::value };
    enum { clause2 = is_sequence<S>::value };
    enum { clause3a = std::is_same< I, P >::value };

Changes to cxxomfort/cxxomfort/library/string.hpp.

5
6
7
8
9
10
11




12
13
14
15
16
17
18
...
328
329
330
331
332
333
334




335
336
337
338
339
340
341
 * @xrefitem cxxo-sup-string "<string>" "Header"
 *
 */

#include <cxxomfort/base.hpp>
#include <cxxomfort/functional.hpp> // functors, binders, placeholders
#include <cxxomfort/string.hpp>




#include <cstring>
#include <string>
#include <sstream>
#include <cxxomfort/algorithm.hpp>
#include "../impl/character.hpp"
#include "../impl/to_basic_string_variadic.hpp"

................................................................................
 * @}
 */


}} // cxxomfort::library







#endif

/**
 * @page cxxo-sup-string
 * @brief cxxomfort Supplementals for <string> 
 * 







>
>
>
>







 







>
>
>
>







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
...
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
 * @xrefitem cxxo-sup-string "<string>" "Header"
 *
 */

#include <cxxomfort/base.hpp>
#include <cxxomfort/functional.hpp> // functors, binders, placeholders
#include <cxxomfort/string.hpp>


#if (CXXOMFORT_CXX_STD>=1997)

#include <cstring>
#include <string>
#include <sstream>
#include <cxxomfort/algorithm.hpp>
#include "../impl/character.hpp"
#include "../impl/to_basic_string_variadic.hpp"

................................................................................
 * @}
 */


}} // cxxomfort::library


#else
	// unsupported
	#error "unsupported"
#endif // CXX_STD

#endif

/**
 * @page cxxo-sup-string
 * @brief cxxomfort Supplementals for <string> 
 * 

Changes to cxxomfort/cxxomfort/library/tuple.hpp.

18
19
20
21
22
23
24

25
26
27
28
29
30
31
...
500
501
502
503
504
505
506


507
508
 * Interfaces brought from impl: @c is_tuple , @c tuple_count_type , @c tuple_index 
 * 
 * All interfaces are defined in the namespace <code>cxxomfort::algorithm::</code>.
 * 
 */




#include <tuple>
#include <cxxomfort/array.hpp>
#include "../impl/tuplemeta.hpp"
#include "../impl/14-integer_sequence.hpp"

// note: for these to work correctly MSVC needs to define _VARIADIC_MAX to >= 9, 
................................................................................
//
// tuple_call (f, Tuple)
// calls f for each member of Tuple
// good for creating tuple visitors
//
#include "../impl/tuple_call.hpp"




#endif







>







 







>
>


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
501
502
503
504
505
506
507
508
509
510
511
 * Interfaces brought from impl: @c is_tuple , @c tuple_count_type , @c tuple_index 
 * 
 * All interfaces are defined in the namespace <code>cxxomfort::algorithm::</code>.
 * 
 */


#if (CXXOMFORT_CXX_STD>=1997)

#include <tuple>
#include <cxxomfort/array.hpp>
#include "../impl/tuplemeta.hpp"
#include "../impl/14-integer_sequence.hpp"

// note: for these to work correctly MSVC needs to define _VARIADIC_MAX to >= 9, 
................................................................................
//
// tuple_call (f, Tuple)
// calls f for each member of Tuple
// good for creating tuple visitors
//
#include "../impl/tuple_call.hpp"

#else // CXX_STD
#endif // CXX_STD

#endif

Changes to cxxomfort/cxxomfort/library/type_name.hpp.

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
    char* res = abi::__cxa_demangle (name,
                                 buf,
                                 &size,
                                 &status);
    buf[sizeof(buf) - 1] = 0;
    return std::string(res);
#else
    return (name);
#endif
}


} //detail_demangle::

/**
 * @brief Demangle a @c typeid() expression if demangling is available
 * @ingroup cxxo-sup
 * @return A demangled version of a <code>typeid(...)</code> return, if available.
 **/

static inline std::string typeid_demangle (std::type_info const& ti) {
    return detail_demangle::job( ti.name() );
}





/**
 * @brief Demangle a typename, recovering information about const / volatile too.
 * @ingroup cxxo-sup
 * @return A string containing a type name depending on the type @a T used to instantiate the function.
 */

template <typename T>







|











>



>
>
>
|
>







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
    char* res = abi::__cxa_demangle (name,
                                 buf,
                                 &size,
                                 &status);
    buf[sizeof(buf) - 1] = 0;
    return std::string(res);
#else
    return name;
#endif
}


} //detail_demangle::

/**
 * @brief Demangle a @c typeid() expression if demangling is available
 * @ingroup cxxo-sup
 * @return A demangled version of a <code>typeid(...)</code> return, if available.
 **/
#if (CXXOMFORT_CXX_STD>=1997)
static inline std::string typeid_demangle (std::type_info const& ti) {
    return detail_demangle::job( ti.name() );
}
#else
static inline std::string_view typeid_demangle (std::type_info const& ti) {
	return ti.name();
}
#endif
/**
 * @brief Demangle a typename, recovering information about const / volatile too.
 * @ingroup cxxo-sup
 * @return A string containing a type name depending on the type @a T used to instantiate the function.
 */

template <typename T>

Changes to cxxomfort/cxxomfort/string.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
30
31
32
33
34
35

36
37
38
39
40
41
42
..
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
..
91
92
93
94
95
96
97

















98
99
100
101
102
103
104
#define CXXOMFORT_STRING_HPP
/**
 * @file 
 * @brief Implementations and additions tied to <code><string></code>.
 * @xrefitem std0string "" ""
 */



#include "base.hpp"
#include <iostream>

#include <string>
#include "cuchar.hpp"

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

namespace cxxomfort {
namespace cxxostd {
}
}



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

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

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

#include <functional>

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

namespace std {

    template<typename Char> 
    struct hash< ::std::basic_string<Char> > {
        typedef ::std::basic_string<Char> argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
................................................................................
    
}
    #else
    // GCC (c++03) does not have u16string, u32string 
namespace std { namespace tr1 {

    template<> 
    struct hash< ::std::u16string > {
        typedef ::std::u16string argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
            using namespace std;
            size_t const MS = (sizeof(size_t) - sizeof(char16_t) + 1) * CHAR_BIT;
            size_t r= s.length(), wi= 1;
            for ( size_t i= 0; i < s.length(); ++i, wi<<=1 ) {
                r ^= (static_cast<size_t>(s[i]) * wi);
................................................................................
                if (wi<<2 > MS ) { wi= 1; }
            }
            return r;
        }    
    };
    
    template<> 
    struct hash< ::std::u32string > {
        typedef ::std::u32string argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
            using namespace std;
            size_t const MS = (sizeof(size_t) - sizeof(char32_t) + 1) * CHAR_BIT;
            size_t r= s.length(), wi= 1;
            for ( size_t i= 0; i < s.length(); ++i, wi<<=1 ) {
                r ^= (static_cast<size_t>(s[i]) * wi);
................................................................................
    

} } // std::tr1

    #endif // gcc
#endif



















#endif

/**
 * @page std0string <string>
 * @brief Backports from <string>
 * 







>
>


>











>
>













|
>







 







|
|







 







|
|







 







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







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
..
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
..
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
#define CXXOMFORT_STRING_HPP
/**
 * @file 
 * @brief Implementations and additions tied to <code><string></code>.
 * @xrefitem std0string "" ""
 */

#if (CXXOMFORT_CXX_STD >= 1997)

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

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

namespace cxxomfort {
namespace cxxostd {
}
}



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

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

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

#include <functional>

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

    template<typename Char> 
    struct hash< ::std::basic_string<Char> > {
        typedef ::std::basic_string<Char> argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
................................................................................
    
}
    #else
    // GCC (c++03) does not have u16string, u32string 
namespace std { namespace tr1 {

    template<> 
    struct hash< std::u16string > {
        typedef std::u16string argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
            using namespace std;
            size_t const MS = (sizeof(size_t) - sizeof(char16_t) + 1) * CHAR_BIT;
            size_t r= s.length(), wi= 1;
            for ( size_t i= 0; i < s.length(); ++i, wi<<=1 ) {
                r ^= (static_cast<size_t>(s[i]) * wi);
................................................................................
                if (wi<<2 > MS ) { wi= 1; }
            }
            return r;
        }    
    };
    
    template<> 
    struct hash< std::u32string > {
        typedef std::u32string argument_type;
        typedef size_t result_type;
        result_type operator()(argument_type const& s) const CXXO_NOEXCEPTNOTHROW   {
            using namespace std;
            size_t const MS = (sizeof(size_t) - sizeof(char32_t) + 1) * CHAR_BIT;
            size_t r= s.length(), wi= 1;
            for ( size_t i= 0; i < s.length(); ++i, wi<<=1 ) {
                r ^= (static_cast<size_t>(s[i]) * wi);
................................................................................
    

} } // std::tr1

    #endif // gcc
#endif


#else // CXX_STD

	#include "impl/11-to_string.hpp"

	#if (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_OW,<1300))
		// lacks an operator<< for basic_string

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

	#endif
#endif // CXX_STD


#endif

/**
 * @page std0string <string>
 * @brief Backports from <string>
 * 

Changes to cxxomfort/cxxomfort/string_view.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
..
37
38
39
40
41
42
43




44
45
46
47
48
49
50
#ifndef CXXOMFORT_STRING_VIEW_HPP
#define CXXOMFORT_STRING_VIEW_HPP

#if (CXXOMFORT_CXX_STD >= 2017)
#include <string_view>
#else
#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;
#if (CXXOMFORT_CXX_STD >= 2011)
    using cxxomfort::cxxostd::u16string_view;
    using cxxomfort::cxxostd::u32string_view;
#endif
}


#include <string>

namespace cxxomfort { namespace fix {

/**
 * @brief Creates a view of a std::string.
 * */
template <typename Char, typename CT>
................................................................................
std::basic_string_view<Char> make_string_view (Char const(&arr)[N]) {
    return std::basic_string_view<Char> (arr, N);
}

} } // cxxomfort::fix

#endif




#endif

/**
 * @page std0string_view <string_view>
 * @brief Backports from <string_view>
 * 
 * Interfaces defined here:





|













>
|







 







>
>
>
>







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
..
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef CXXOMFORT_STRING_VIEW_HPP
#define CXXOMFORT_STRING_VIEW_HPP

#if (CXXOMFORT_CXX_STD >= 2017)
#include <string_view>
#elif (1 || CXXOMFORT_CXX_STD >= 1997)
#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;
#if (CXXOMFORT_CXX_STD >= 2011)
    using cxxomfort::cxxostd::u16string_view;
    using cxxomfort::cxxostd::u32string_view;
#endif
}

#if (CXXOMFORT_CXX_STD>=1997)
	#include <string>

namespace cxxomfort { namespace fix {

/**
 * @brief Creates a view of a std::string.
 * */
template <typename Char, typename CT>
................................................................................
std::basic_string_view<Char> make_string_view (Char const(&arr)[N]) {
    return std::basic_string_view<Char> (arr, N);
}

} } // cxxomfort::fix

#endif


#else // C++<1997
#endif
#endif

/**
 * @page std0string_view <string_view>
 * @brief Backports from <string_view>
 * 
 * Interfaces defined here:

Changes to cxxomfort/cxxomfort/system_error.hpp.

2
3
4
5
6
7
8



9
10
11
12
13
14
15
..
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
...
522
523
524
525
526
527
528




529
530
531
532
533
534
535
#define CXXOMFORT_SYSTEM_ERROR_HPP
/**
 * @file
 * @xrefitem std0system_error "<system_error>" "Header"
 * 
 */





/*
 * MSVC 2010 has a broken <system_error> that defines errc inside a 
 * namespace also called errc, making it impossible to 
 * declare variables of type std::errc.
 * 
 * Because of this, in the case of MSVC 2010 specifically, 
................................................................................
#include "impl/11-to_string.hpp"
#include <stdexcept>
#include <string>
#include <cstring> // strerror
#include <cerrno>
#include <utility> // make_pair, operator<

#if (defined(DOXIGEN_DOC) || (CXXOMFORT_CXX_STD < 2011))
// start code for implementation of system_error

#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_EMULATION()

#if (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_MSC)
    #pragma warning (disable:4996) // MSVC: function may be unsafe
#endif
................................................................................
#else
    return static_cast<errc>(E);
#endif
}

} } // cxxomfort::fix





#endif

/**
 * @page std0system_error
 * 
 * @brief Backports and interfaces for C++11's <system_error> .
 * 







>
>
>







 







|







 







>
>
>
>







2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
..
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
...
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
#define CXXOMFORT_SYSTEM_ERROR_HPP
/**
 * @file
 * @xrefitem std0system_error "<system_error>" "Header"
 * 
 */

#if (CXXOMFORT_CXX_STD>=2011)

#elif (CXXOMFORT_CXX_STD>=1997)

/*
 * MSVC 2010 has a broken <system_error> that defines errc inside a 
 * namespace also called errc, making it impossible to 
 * declare variables of type std::errc.
 * 
 * Because of this, in the case of MSVC 2010 specifically, 
................................................................................
#include "impl/11-to_string.hpp"
#include <stdexcept>
#include <string>
#include <cstring> // strerror
#include <cerrno>
#include <utility> // make_pair, operator<

#if ((CXXOMFORT_CXX_STD < 2011))
// start code for implementation of system_error

#define CXXOMFORT_IMPLEMENTS_header_system_error CXXO_IMPLSTATUS_EMULATION()

#if (CXXOMFORT_COMPILER_ID == CXXO_COMPILERID_MSC)
    #pragma warning (disable:4996) // MSVC: function may be unsafe
#endif
................................................................................
#else
    return static_cast<errc>(E);
#endif
}

} } // cxxomfort::fix


#else // CXXOMFORT_CXX_STD

#endif // CXXOMFORT_CXX_STD
#endif

/**
 * @page std0system_error
 * 
 * @brief Backports and interfaces for C++11's <system_error> .
 * 

Changes to cxxomfort/cxxomfort/tuple.hpp.

3
4
5
6
7
8
9




10
11
12
13
14
15
16
..
36
37
38
39
40
41
42




43
44
45
46
47
48
49
/**
 * @file
 * @brief Implementations and backports related to <code><tuple></code>.
 * @ingroup std0tuple
 * 
 */






#include "base.hpp"
#include "utility.hpp" // index_sequence
#include <tuple> // d'uh
#include <array> // array <-> tuple conversions

#if (defined(CXXOMFORT_NOTICES) && CXXOMFORT_NOTICES > 1)
................................................................................

namespace cxxomfort {
namespace cxxostd {


} //cxxomfort::cxxostd
} //





#endif

/**
 * @page std0tuple <tuple>
 * @brief cxxomfort Backports for features in <tuple>
 * 







>
>
>
>







 







>
>
>
>







3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/**
 * @file
 * @brief Implementations and backports related to <code><tuple></code>.
 * @ingroup std0tuple
 * 
 */

#if (CXXOMFORT_CXX_STD>=2011)
	#include <tuple>

#elif (CXXOMFORT_CXX_STD>=1997)

#include "base.hpp"
#include "utility.hpp" // index_sequence
#include <tuple> // d'uh
#include <array> // array <-> tuple conversions

#if (defined(CXXOMFORT_NOTICES) && CXXOMFORT_NOTICES > 1)
................................................................................

namespace cxxomfort {
namespace cxxostd {


} //cxxomfort::cxxostd
} //

#else // CXX_STD < 1997

#endif // CXX_STD

#endif

/**
 * @page std0tuple <tuple>
 * @brief cxxomfort Backports for features in <tuple>
 * 

Changes to cxxomfort/cxxomfort/type_traits.hpp.

528
529
530
531
532
533
534








535
536
537
538
539
540
541
template< class T >
struct remove_cvref 
: public remove_cv < typename remove_reference<T>::type > 
{
};

} // std









#endif // CXX_STD >= 1997

#endif // #include guard

/**
 * @page std0type_traits <type_traits>







>
>
>
>
>
>
>
>







528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
template< class T >
struct remove_cvref 
: public remove_cv < typename remove_reference<T>::type > 
{
};

} // std

#else // CXX_STD < 1997
	#include <cxxomfort/util/type_traits.hpp>

namespace std {
	using namespace cxxomfort::traits;
}


#endif // CXX_STD >= 1997

#endif // #include guard

/**
 * @page std0type_traits <type_traits>

Changes to cxxomfort/cxxomfort/typeindex.hpp.

9
10
11
12
13
14
15


16
17
18
19
20
21
22
..
53
54
55
56
57
58
59




60
61
62
63
64
65
66
 * * @c type_index (C++11)
 * * @c hash<type_index> (C++11)
 *
 * @see https://en.cppreference.com/w/cpp/header/typeindex
 * 
 */



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

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

#if (CXXOMFORT_CXX_STD >= 2011 || CXXO_COMPILER_SUPPORT_cstd_typeindex>0)
    #include <typeindex>
................................................................................
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    } // tr1
    #endif

}
#endif
#endif // no_std_using




#endif

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







>
>







 







>
>
>
>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 * * @c type_index (C++11)
 * * @c hash<type_index> (C++11)
 *
 * @see https://en.cppreference.com/w/cpp/header/typeindex
 * 
 */

#if (CXXOMFORT_CXX_STD>=1997)

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

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

#if (CXXOMFORT_CXX_STD >= 2011 || CXXO_COMPILER_SUPPORT_cstd_typeindex>0)
    #include <typeindex>
................................................................................
    #if (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC)
    } // tr1
    #endif

}
#endif
#endif // no_std_using

#else // CXX_STD
#endif

#endif

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