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

Overview
Comment:Commit 2018-08-17 - Corrections for MSVC 2010/2012 compat.
  • config: Fixed detection of MSVC 2010, 2012 features.
  • random: Fixed C++03 feature renames that are for GCC only.
  • string: Fixed missing strto(u)ll in MSVC 2010,2012 fixed.
  • string: Fixed to_string for MSVC 2012.
  • string: Fixed to_string, strtoull overloads for MSVC 2012.
  • type_traits: Added enable_if, conditional moved to their own file and fixed for C++03 support.
  • library: string: Fixed utf8chr function calls.
  • extras: array_ref: Fixed the fixed_vector constructor.
  • Upcoming Changes:
  • Changes to <functional>: functors.
  • Changes to <type_traits>: minimal TR1.
  • Additions to <cstddef>: user defined literals.
  • Additions to <functional>: not_fn.
  • Additions to cstd: <optional>.
  • Additions to cstd: <variant>.
  • Additions to <library/random>: distributor wrappers.
  • Additions to <library/string>: strsprintf.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6fe18ebc25bc0f8f25c402f4d5df2cceadeb9a22
User & Date: luismachuca 2018-08-17 04:41:12
Context
2018-08-22
04:58
Commit 2018-08-21 - Minmax: Min corrections and Max namespacing
  • config: Introduced namespace 'library' for cxxomfort library extensions.
  • config: Added detection of old-style <functional> binders in preparation for C++20.
  • config: Fixed detection of features in GCC (typeof, enable_if, etc).
  • algorithm: Fixed move minmax, minmax_element to their own header.
  • iterator: Fixed size to be moved to own file and re-implemented as per C++17 std::size.
  • type_traits: Added std::endian support (but unused in this release).
  • type_traits: Added std::bool_constant support.
  • type_traits: Added std::type_identity support.
  • library: Fixed namespacing for CXXO_FOREACH, I12N, variadic to_string, type_name utils, typesafe enum (minor).
  • tags: Updated with library string, algorithm functions.
check-in: d22509b5 user: luismachuca tags: trunk
2018-08-17
04:41
Commit 2018-08-17 - Corrections for MSVC 2010/2012 compat.
  • config: Fixed detection of MSVC 2010, 2012 features.
  • random: Fixed C++03 feature renames that are for GCC only.
  • string: Fixed missing strto(u)ll in MSVC 2010,2012 fixed.
  • string: Fixed to_string for MSVC 2012.
  • string: Fixed to_string, strtoull overloads for MSVC 2012.
  • type_traits: Added enable_if, conditional moved to their own file and fixed for C++03 support.
  • library: string: Fixed utf8chr function calls.
  • extras: array_ref: Fixed the fixed_vector constructor.
  • Upcoming Changes:
  • Changes to <functional>: functors.
  • Changes to <type_traits>: minimal TR1.
  • Additions to <cstddef>: user defined literals.
  • Additions to <functional>: not_fn.
  • Additions to cstd: <optional>.
  • Additions to cstd: <variant>.
  • Additions to <library/random>: distributor wrappers.
  • Additions to <library/string>: strsprintf.
check-in: 6fe18ebc user: luismachuca tags: trunk
2018-07-03
03:05
Commit 2018-07-01 - Forward with library improvements, <numeric> and build logs.
  • cxxomfort: Corrected CXXOMFORT_NOTICES in various headers.
  • cxxomfort: Cleared most "typedef unused" warnings.
  • cxxomfort: Most if not all files converted to LF line endings.
  • cxxomfort: CXXOMFORT_DATE now uses full YYYYMMDD format.
  • cxxomfort: CXXOMFORT_NO_STD_USING.
  • cxxomfort: Added numeric.hpp and numerics to library.
  • cxxomfort: Header files also include javadoc code for generating future documentation.
  • library: algorithm: Added inplace_if.
  • library: numeric: Added static_gcd, static_lcm.
  • library: string: Added chr, wchr, utf8chr.
  • library: string: Added split_to.
  • impl: byte is moved to namespace cxxomfort::cstddef.
  • cstdint: Now c++11 emulation mode also relies on pstdint.h.
  • forward_list: Fixed the implementation of insert_after, emplace_after.
  • iterator: Removed warnings about unused typedefs in begin(), end().
  • memory: Updated make_unique as well as its STD requirements to go below C++14.
  • tuple: Removed a warning about aggregate brackets.
  • type_traits: enable_if, conditional moved to their own impl file.
check-in: 5862a10f user: luismachuca tags: trunk
Changes

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

50
51
52
53
54
55
56


57
58
59
60
61
62
63
#endif

#if (CXXOMFORT_COMPILER_VERSION >= 160) // VC10 or higher
    #undef  CXXOMFORT_CXX_EMULATION
    #define CXXOMFORT_CXX_EMULATION 2011
    #undef  CXXO_COMPILER_SUPPORT_auto
    #define CXXO_COMPILER_SUPPORT_auto 1


    #undef  CXXO_COMPILER_SUPPORT_decltype
    #define CXXO_COMPILER_SUPPORT_decltype 1
    #undef  CXXO_COMPILER_SUPPORT_iterator_helpers
    #define CXXO_COMPILER_SUPPORT_iterator_helpers 0
    #undef  CXXO_COMPILER_SUPPORT_local_types
    #define CXXO_COMPILER_SUPPORT_local_types 1
    #undef  CXXO_COMPILER_SUPPORT_nullptr







>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#endif

#if (CXXOMFORT_COMPILER_VERSION >= 160) // VC10 or higher
    #undef  CXXOMFORT_CXX_EMULATION
    #define CXXOMFORT_CXX_EMULATION 2011
    #undef  CXXO_COMPILER_SUPPORT_auto
    #define CXXO_COMPILER_SUPPORT_auto 1
    #undef  CXXO_COMPILER_SUPPORT_conditional_enableif
    #define CXXO_COMPILER_SUPPORT_conditional_enableif 1
    #undef  CXXO_COMPILER_SUPPORT_decltype
    #define CXXO_COMPILER_SUPPORT_decltype 1
    #undef  CXXO_COMPILER_SUPPORT_iterator_helpers
    #define CXXO_COMPILER_SUPPORT_iterator_helpers 0
    #undef  CXXO_COMPILER_SUPPORT_local_types
    #define CXXO_COMPILER_SUPPORT_local_types 1
    #undef  CXXO_COMPILER_SUPPORT_nullptr

Changes to cxxomfort/cxxomfort/extras/array_ref.hpp.

92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    : ptr_(std::addressof(va[0])), len_(va.size()) {}

    // view ref from dynarray; should be a std::array conversion operator but can't in C++11
    array_ref (::cxxomfort::extras::dynarray::dynarray<T> const& da) CXXO_NOEXCEPT
    : ptr_(da.data()), len_(da.size()) {}

    // view_ref from fixed_vector; should be a fixed_vector conversion operator but that would include extras from library.
    array_ref (::cxxomfort::fixed_vector<T> const& vec) CXXO_NOEXCEPT 
    : ptr_(vec.data()), len_(da.size()) {}

    // access to elements
    //reference       at (size_t len) { assert_range(len); return ptr_[len]; }
    const_reference at (size_t len) const { assert_range(len); return ptr_[len]; }
    //reference       operator[] (size_t len) CXXO_NOEXCEPT { return ptr_[len]; }
    const_reference operator[] (size_t len) const CXXO_NOEXCEPT { return ptr_[len]; }
    







|
|







92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    : ptr_(std::addressof(va[0])), len_(va.size()) {}

    // view ref from dynarray; should be a std::array conversion operator but can't in C++11
    array_ref (::cxxomfort::extras::dynarray::dynarray<T> const& da) CXXO_NOEXCEPT
    : ptr_(da.data()), len_(da.size()) {}

    // view_ref from fixed_vector; should be a fixed_vector conversion operator but that would include extras from library.
    array_ref (::cxxomfort::fixed_vector<T> const& r) CXXO_NOEXCEPT 
    : ptr_(r.data()), len_(r.size()) {}

    // access to elements
    //reference       at (size_t len) { assert_range(len); return ptr_[len]; }
    const_reference at (size_t len) const { assert_range(len); return ptr_[len]; }
    //reference       operator[] (size_t len) CXXO_NOEXCEPT { return ptr_[len]; }
    const_reference operator[] (size_t len) const CXXO_NOEXCEPT { return ptr_[len]; }
    

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

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 * @file
 */

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

// fix renamed functors in <random> between C++03 TR1 and C++11
#if ((CXXOMFORT_CXX_STD < 2011) || (defined(DOXYGEN_DOC)))
namespace std {
namespace tr1 {

// These are only "good enough to work" fixes.

//! @ingroup cxx11-backports
template <typename II, II _w, II _s, II _r>







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 * @file
 */

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

// fix renamed functors in <random> between C++03 TR1 and C++11
#if ((CXXOMFORT_CXX_STD < 2011) && (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC||CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_CLANG))
namespace std {
namespace tr1 {

// These are only "good enough to work" fixes.

//! @ingroup cxx11-backports
template <typename II, II _w, II _s, II _r>

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

7
8
9
10
11
12
13

14
15
16
17
18
19
20
..
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
 *
 */

#include "../config.hpp"

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_conditional


namespace cxxomfort {
namespace type_traits {

template <bool B, typename T=void>
struct enable_if{};

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

template <typename T, typename U>
struct conditional<true,T,U> { typedef T type; };

} // type_traits
} // cxxomfort


namespace std {
    using ::cxxomfort::type_traits::enable_if;
    using ::cxxomfort::type_traits::conditional;
}

#endif

#endif // file







>







 







|




<

>

7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
..
32
33
34
35
36
37
38
39
40
41
42
43

44
45
46
 *
 */

#include "../config.hpp"

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_conditional
#endif

namespace cxxomfort {
namespace type_traits {

template <bool B, typename T=void>
struct enable_if{};

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

template <typename T, typename U>
struct conditional<true,T,U> { typedef T type; };

} // type_traits
} // cxxomfort

#if (CXXO_COMPILER_SUPPORT_conditional_enableif==0)
namespace std {
    using ::cxxomfort::type_traits::enable_if;
    using ::cxxomfort::type_traits::conditional;
}

#endif

#endif // file

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

153
154
155
156
157
158
159



160

161
162
163
164
165
166
167



168

169
170
171
172
173
174
175
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);



    static fn_t fn () { return strtoull; }

};
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);



    static fn_t fn () { return strtoll; }

};


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)







>
>
>

>







>
>
>

>







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

Changes to cxxomfort/cxxomfort/library/stringfn.hpp.

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		chu[0]= (cp>>18)+240;
		chu[1]= ((cp>>12)&63)+128;
		chu[2]= ((cp>>6)&63)+128;
		chu[3]= (cp&63)+128;
	}
	// if($num<=0x1FFFFF)   return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128).chr(($num&63)+128);
	//cerr<< hex<< cp<< " utf8chr -> { "<< chr[0]<< ' '<< chr[1]<< ' '<< chr[2]<< ' '<< chr[3]<< ' '<< chr[4]<< " }; "<< endl;
	return string(chu);
}


/**
 * Joins all contents from [ini,fin) into a string.
 * @param sep Joining string.
 * @param ini,fin Delimiters to the sequence of elements.







|







96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
		chu[0]= (cp>>18)+240;
		chu[1]= ((cp>>12)&63)+128;
		chu[2]= ((cp>>6)&63)+128;
		chu[3]= (cp&63)+128;
	}
	// if($num<=0x1FFFFF)   return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128).chr(($num&63)+128);
	//cerr<< hex<< cp<< " utf8chr -> { "<< chr[0]<< ' '<< chr[1]<< ' '<< chr[2]<< ' '<< chr[3]<< ' '<< chr[4]<< " }; "<< endl;
	return (chu);
}


/**
 * Joins all contents from [ini,fin) into a string.
 * @param sep Joining string.
 * @param ini,fin Delimiters to the sequence of elements.

Changes to cxxomfort/cxxomfort/util/meta.hpp.

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define CXXOMFORT_UTIL_META_HPP
/**
 * @brief Implements some of the type_traits additions in C++03.
 * @author Luis Machuca Bezzaza <luis [dot] machuca [at] gulix [dot] cl>
 *
 * Interfaces defined in this header:
 *
 * * enable_if, conditional (also for namespace std)
 * * identity
 * * disable_if
 * * selection
 * * meta_and, meta_or
 * 
 */








<







2
3
4
5
6
7
8

9
10
11
12
13
14
15
#define CXXOMFORT_UTIL_META_HPP
/**
 * @brief Implements some of the type_traits additions in C++03.
 * @author Luis Machuca Bezzaza <luis [dot] machuca [at] gulix [dot] cl>
 *
 * Interfaces defined in this header:
 *

 * * identity
 * * disable_if
 * * selection
 * * meta_and, meta_or
 * 
 */