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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:d22509b55b60dac8d898fddd7015ee31b86379d2
User & Date: luismachuca 2018-08-22 04:58:58
Context
2018-09-23
01:16
Commit 2018-09-22 - Static Library in the Upload
  • random: Added backport for shuffle_order_engine, knuth_b.
  • random: Fixed subtract_with_carry_engine to compile with MSVC.
  • system_error: Added header with minimum capabilities (errc and error_category).
  • type_traits: Moved decay, underlying_type, common_type to their own headers.
  • cstd: Added <system_error> forwarder header.
  • library: Added static math templates to numericfn (static_{min/max/minmax}, etc).
  • library: Added begin, end members to seq_<>, for interoperability.
  • library: Moved non-std functions from cxxomfort::tuple to this set (tuple_pop etc).
  • library: Moved sequence utilities (seq_, etc) to library namespace.
  • library: Moved array_ref from extras.
  • impl/metaprogramming.hpp: Added compose, make_and, make_or.
  • docs: Added lots of comment blocks in the hopes of setting up Doxygen documentation for the future.
check-in: 2f656bdc user: luismachuca tags: trunk
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
Changes

Changes to cxxomfort/cxxomfort/VERSION.txt.

     1         -cxxomfort 0.70 2018-07-01
            1  +cxxomfort 0.72 2018-07-01

Changes to cxxomfort/cxxomfort/algorithm.hpp.

   101    101   template <typename Iterator>
   102    102   inline bool is_sorted (Iterator ini, Iterator fin) {
   103    103       std::less<typename std::iterator_traits<Iterator>::value_type> less;
   104    104       return is_sorted(ini,fin,less);
   105    105   }
   106    106   
   107    107   
   108         -//
   109         -// minmax, minmax_element
   110         -//
   111         -
   112         -//! return a <code>pair(min,max)</code> from two arguments and a comparator @a Less .
   113         -template <typename T, typename Comparator>
   114         -std::pair<T const&, T const&> minmax (T const& a, T const& b, Comparator Less) {
   115         -    return Less(b,a) ? 
   116         -    std::make_pair(b, a) : std::make_pair(a, b)
   117         -    ;
   118         -}
   119         -
   120         -//! @overload minmax
   121         -template <typename T>
   122         -std::pair<T const&, T const&> minmax (T const& a, T const& b)  {
   123         -    return (b < a) ? 
   124         -    std::pair<T const&,T const&>(b, a) : std::pair<T const&,T const&>(a, b)
   125         -    ;
   126         -}
   127         -
   128         -//! Returns the pair (minimum,maximum) for the given sequence and comparator @p less .
   129         -template <typename FIterator, typename Comparator>
   130         -std::pair<FIterator,FIterator> 
   131         -minmax_element (FIterator ini, FIterator fin, Comparator less) {
   132         -    std::pair<FIterator, FIterator> result(ini, fin);
   133         - 
   134         -    if (ini == fin) return result;
   135         -    if (++ini == fin) return result;
   136         -
   137         -    if (less(*ini, *result.ini)) {
   138         -        result.second = result.ini;
   139         -        result.ini = ini;
   140         -    } else {
   141         -        result.second = ini;
   142         -    }
   143         -    while (++ini != fin) {
   144         -        FIterator i = ini;
   145         -        if (++ini == fin) {
   146         -            if (less(*i, *result.ini)) result.ini = i;
   147         -            else if (!(less(*i, *result.second))) result.second = i;
   148         -            break;
   149         -        } else {
   150         -            if (less(*ini, *i)) {
   151         -                if (less(*ini, *result.ini)) result.ini = ini;
   152         -                if (!(less(*i, *result.second))) result.second = i;
   153         -            } else {
   154         -                if (less(*i, *result.ini)) result.ini = i;
   155         -                if (!(less(*ini, *result.second))) result.second = ini;
   156         -            }
   157         -        }
   158         -    }
   159         -    return result;
   160         -
   161         -}
   162         -
   163         -//! @overload minmax_element
   164         -template <typename FIterator>
   165         -std::pair<FIterator,FIterator> 
   166         -minmax_element (FIterator ini, FIterator fin) {
   167         -    std::less <typename std::iterator_traits<FIterator>::value_type> less;
   168         -    return minmax_element(ini, fin, less);
   169         -}
   170    108   
   171    109   
   172    110   // detail helpers for shuffle
   173    111   namespace detail_algorithm {
   174    112   
   175    113       template <typename URNG, typename E>
   176    114       E uniform_in (URNG& u, E m1, E m2) {
................................................................................
   218    156   
   219    157   #define CXXOMFORT_IMPLEMENTS_n1990 CXXO_BACKPORT()
   220    158   
   221    159   // These are in their own files
   222    160   //#include "impl/03-minmax.hpp"
   223    161   // included in c++11 onwards
   224    162   #include "impl/11-is_xxx_of.hpp"
          163  +#include "impl/11-minmax.hpp"
   225    164   #include "impl/11-permutations.hpp"
   226    165   // c++14 onwards
   227    166   #include "impl/14-algorithm-equal.hpp"
   228    167   // pending: #include "impl/modifying.hpp"
   229    168   // c++17 onwards(?)
   230    169   #include "impl/17-clamp.hpp"
   231    170   
................................................................................
   243    182       using ::cxxomfort::algorithm::copy_n;
   244    183       using ::cxxomfort::algorithm::partition_copy;
   245    184   
   246    185       using ::cxxomfort::algorithm::find_if_not;
   247    186       //using ::cxxomfort::algorithm::iota;
   248    187   
   249    188       using ::cxxomfort::algorithm::is_sorted;
   250         -    using ::cxxomfort::algorithm::minmax;
   251         -    using ::cxxomfort::algorithm::minmax_element;
   252    189       using ::cxxomfort::algorithm::shuffle;
   253    190       
   254    191       using ::cxxomfort::algorithm::for_each_n;
   255    192       
   256    193   }
   257    194   #endif // std using
   258    195   

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

   231    231   , typename std::iterator_traits<FIterator>::difference_type n = 1
   232    232   ) {
   233    233       std::advance(i, -n);
   234    234       return i;
   235    235   }
   236    236   
   237    237   
   238         -//
   239         -// From proposal N4017
   240         -//
   241         -// This implements a nonmember size() that calls member .size().
   242         -// For containers that somehow don't have size() (looking at you forward_list >_>)
   243         -// let's do distance(.begin(),.end())
   244         -
   245         -namespace detail_size {
   246         -template <typename C, bool F=false> struct call_size_has {
   247         -    typename C::difference_type operator() (C const& c) const { 
   248         -        return std::distance(c.begin() , c.end());
   249         -    }
   250         -}; // call_size_has
   251         -
   252         -template <typename C> struct call_size_has<C,true> {
   253         -    typename C::difference_type operator() (C const& c) const { 
   254         -        return c.size();
   255         -    }
   256         -}; // call_size_has
   257         -
   258         -} // detail_size
   259         -
   260         -template <typename C> inline
   261         -typename C::difference_type
   262         -size (C & c) {
   263         -    typedef typename C::iterator iterator;
   264         -    (void)iterator();
   265         -    typedef typename C::difference_type difference_type;
   266         -    (void)difference_type();
   267         -    typedef typename C::value_type value_type;
   268         -    (void)value_type();
   269         -    const detail_size::call_size_has< C, iterator_accessors_helper<C>::has_size > s={};
   270         -    return s(c);
   271         -}
   272         -
   273         -// overload for native arrays
   274         -template <typename T, size_t N> inline
   275         -size_t size (T(&arr)[N]) {
   276         -    (void)arr;
   277         -    return N;
   278         -}
   279    238   
   280    239   #if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC \
   281    240       && CXXOMFORT_COMPILER_VERSION >= 408)
   282    241   #pragma GCC diagnostic pop
   283    242   #endif
   284    243   
   285    244   /**
................................................................................
   298    257   /*
   299    258    * Provide begin, end support for std::valarray as well.
   300    259    */
   301    260   namespace std {
   302    261   template <typename T> class valarray;
   303    262   }
   304    263   
   305         -namespace cxxomfort {
          264  +namespace cxxomfort { namespace iterator {
   306    265   
   307    266   template <typename T> inline
   308    267   T* begin (std::valarray<T> & c) { return addressof(c[0]); }
   309    268   
   310    269   template <typename T> inline
   311    270   T const* begin (std::valarray<T> const& c) { return addressof(c[0]); }
   312    271   
................................................................................
   313    272   template <typename T> inline
   314    273   T* end (std::valarray<T> & c) { return addressof(c[0])+c.size(); }
   315    274   
   316    275   template <typename T> inline
   317    276   T const* end (std::valarray<T> const& c) { return addressof(c[0])+c.size(); }
   318    277   
   319    278   
          279  +}
   320    280   } //~::cxxomfort
   321    281   
   322    282   
   323    283   #endif // valarray support
   324    284   
   325    285   
   326    286   namespace std {
................................................................................
   339    299       using ::cxxomfort::iterator::prev;
   340    300       #endif
   341    301   
   342    302   #else
   343    303   	using ::cxxomfort::iterator::cbegin;
   344    304   	using ::cxxomfort::iterator::cend;
   345    305   #endif
   346         -    //using ::cxxomfort::size; // not enabled yet
   347    306   }
          307  +
          308  +#include "../impl/17-size.hpp"
   348    309   
   349    310   #endif

Changes to cxxomfort/cxxomfort/config.hpp.

     6      6    * @author Luis Machuca Bezzaza
     7      7    *
     8      8    * This file contains configuration macros used by the cxxomfort library
     9      9    * and it is not intended to be directly used.
    10     10    */
    11     11   
    12     12   //! Library version and release date as YYYYMMDD
    13         -#define CXXOMFORT_DATE 20180701UL
           13  +#define CXXOMFORT_DATE 20180821UL
    14     14   //! Defines the library version (WARNING: to be deprecated)
    15         -#define CXXOMFORT_VERSION 60
           15  +#define CXXOMFORT_VERSION 72
    16     16   
    17     17   #define CXXO_STRINGIZE_IMPL(x) #x
    18     18   #define CXXO_STRINGIZE(x) CXXO_STRINGIZE_IMPL(x)
    19     19   #define CXXO_JOIN(x,y) x##y
    20     20   
    21     21   //
    22     22   // Standard Mode
................................................................................
    40     40   //
    41     41   // Set different flags according to the features 
    42     42   // supported by the compiler
    43     43   //
    44     44   
    45     45   //! If compiler includes tr1/random header in c++03 mode
    46     46   #define CXXO_COMPILER_SUPPORT_tr1_random 0
           47  +//! If compiler includes tr1/tuple header in c++03 mode
           48  +#define CXXO_COMPILER_SUPPORT_tr1_tuple 0
    47     49   //! If compiler includes tr1/type_traits header in c++03 mode
    48     50   #define CXXO_COMPILER_SUPPORT_tr1_type_traits 0
    49         -//! If compiler provides support for @c __typeof__ in C++03.
    50         -#define CXXO_COMPILER_SUPPORT_typeof 0
    51         -//! If compiler provides support for variadic macros (<code>__VA_ARG__</code>).
    52         -#define CXXO_COMPILER_SUPPORT_va_args 0
    53         -
    54     51   //! If compiler provides support for alignment tools (@c alignas , etc).
    55     52   #define CXXO_COMPILER_SUPPORT_alignment_tools 0
    56     53   //! If compiler provides support for @c alignof(T) .
    57     54   #define CXXO_COMPILER_SUPPORT_alignof 0
    58     55   //! If compiler provides support for <code>[[__attribute__]]</code>.
    59     56   #define CXXO_COMPILER_SUPPORT_attribute (CXXOMFORT_CXX_STD >= 2011)
    60     57   //! If compiler supports new (type-deduction) semantics for @c auto .
    61     58   #define CXXO_COMPILER_SUPPORT_auto (CXXOMFORT_CXX_STD>=2011)
           59  +//! If compiler provides support for the new C++11 helpers std::enable_if, std::conditional.
           60  +#define CXXO_COMPILER_SUPPORT_conditional_enableif (CXXOMFORT_CXX_STD>=2011)
    62     61   //! If compiler provides support for @c constexpr .
    63     62   #define CXXO_COMPILER_SUPPORT_constexpr (CXXOMFORT_CXX_STD>=2011)
           63  +//! If compiler provides support for C++14's relaxed form of @c constexpr .
           64  +#define CXXO_COMPILER_SUPPORT_constexpr_relaxed (CXXOMFORT_CXX_STD>=2014)
    64     65   //! If compiler supports @c decltype(expr) .
    65     66   #define CXXO_COMPILER_SUPPORT_decltype (CXXOMFORT_CXX_STD>=2011)
    66     67   //! If compiler provides support for <code>=default</code>-ed and <code>=delete</code>-d members.
    67     68   #define CXXO_COMPILER_SUPPORT_default_delete (CXXOMFORT_CXX_STD>=2011)
           69  +//! If compiler provides support for endianness tag (std::endian)
           70  +#define CXXO_COMPILER_SUPPORT_endian (CXXOMFORT_CXX_STD>=2020)
    68     71   //! If compiler provides support for scoped enumerations ie.: <code>enum class...</code>.
    69     72   #define CXXO_COMPILER_SUPPORT_enum_class (CXXOMFORT_CXX_STD>=2011)
    70     73   //! If compiler provides support for <code>explicit operator ...</code> casts.
    71     74   #define CXXO_COMPILER_SUPPORT_explicit_operator (CXXOMFORT_CXX_STD>=2011)
    72     75   //! If compiler provides support for range-for.
    73     76   #define CXXO_COMPILER_SUPPORT_foreach (CXXOMFORT_CXX_STD>=2011)
           77  +//! If compiler provides support for <functional>'s classical binders.
           78  +#define CXXO_COMPILER_SUPPORT_functional_oldstyle (CXXOMFORT_CXX_STD<2017)
           79  +//! If compiler supports <functional> 's transparent functors.
           80  +#define CXXO_COMPILER_SUPPORT_functional_transparent (CXXOMFORT_CXX_STD >= 2014)
    74     81   //! If compiler provides support for @c std::initializer_list .
    75     82   #define CXXO_COMPILER_SUPPORT_initializer_list (CXXOMFORT_CXX_STD>=2011)
           83  +//! If compiler provides support for "integer_sequence".
           84  +#define CXXO_COMPILER_SUPPORT_integer_sequence (CXXOMFORT_CXX_STD >= 2014)
    76     85   //! If compiler provides support for local and unnamed types as template arguments.
    77     86   #define CXXO_COMPILER_SUPPORT_local_types (CXXOMFORT_CXX_STD>=2011)
    78     87   //! If compiler provides support for @c noexcept *AND* is_noexcept-traits.
    79     88   #define CXXO_COMPILER_SUPPORT_noexcept (CXXOMFORT_CXX_STD>=2011)
    80     89   //! If compiler provides support for @c nullptr  and @c std::nullptr_t .
    81     90   #define CXXO_COMPILER_SUPPORT_nullptr (CXXOMFORT_CXX_STD>=2011)
    82     91   //! If compiler provides support for @c T&& .
    83     92   #define CXXO_COMPILER_SUPPORT_rvref (CXXOMFORT_CXX_STD>=2011)
           93  +//! If compiler provides support for @c __typeof__ in C++03.
           94  +#define CXXO_COMPILER_SUPPORT_typeof 0
    84     95   //! If compiler provides support for @c static_assert .
    85     96   #define CXXO_COMPILER_SUPPORT_static_assert (CXXOMFORT_CXX_STD>=2011)
    86     97   //! If compiler provides support for the new C++11 std algorithms.
    87     98   #define CXXO_COMPILER_SUPPORT_std_cxx11_algorithms (CXXOMFORT_CXX_STD>=2011)
    88     99   //! If compiler provides support for the new C++11 helpers std::begin, std::end.
    89    100   #define CXXO_COMPILER_SUPPORT_std_iterator_helpers (CXXOMFORT_CXX_STD>=2011)
    90    101   //! If compiler provides support for std::next, std::prev.
................................................................................
    99    110   #define CXXO_COMPILER_SUPPORT_std_cxx11_constructible_traits 0
   100    111   //! If compiler provides support for trailing return types.
   101    112   #define CXXO_COMPILER_SUPPORT_trailing_returns (CXXOMFORT_CXX_STD>=2011)
   102    113   //! If compiler provides support for @c unique_ptr<T> .
   103    114   #define CXXO_COMPILER_SUPPORT_unique_ptr (CXXOMFORT_CXX_STD>=2011)
   104    115   //! If compiler provides support for variadic templates.
   105    116   #define CXXO_COMPILER_SUPPORT_variadic (CXXOMFORT_CXX_STD>=2011)
   106         -
   107         -//! If compiler provides support for C++14's relaxed form of @c constexpr .
   108         -#define CXXO_COMPILER_SUPPORT_constexpr_relaxed (CXXOMFORT_CXX_STD>=2014)
   109         -//! If compiler supports <functional> 's transparent functors.
   110         -#define CXXO_COMPILER_SUPPORT_functional_transparent (CXXOMFORT_CXX_STD >= 2014)
   111         -//! If compiler provides support for "integer_sequence".
   112         -#define CXXO_COMPILER_SUPPORT_integer_sequence (CXXOMFORT_CXX_STD >= 2014)
          117  +//! If compiler provides support for variadic macros (<code>__VA_ARG__</code>).
          118  +#define CXXO_COMPILER_SUPPORT_va_args 0
   113    119   
   114    120   
   115    121   
   116    122   //------------------------------------------------
   117    123   
   118    124   // Detect CXX_STD and operation mode (initial)
   119    125   

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

    70     70           // Note: *Unsupported* c++0x emulation mode
    71     71           #define CXXOMFORT_CXX_EMULATION 2011
    72     72           #pragma message CXXO_WARNING( "Configuration not supported (nullptr and other basic features are missing)" )
    73     73           #undef  CXXO_COMPILER_SUPPORT_alignof
    74     74           #define CXXO_COMPILER_SUPPORT_alignof 1
    75     75           #undef  CXXO_COMPILER_SUPPORT_auto
    76     76           #define CXXO_COMPILER_SUPPORT_auto 1
           77  +        #undef  CXXO_COMPILER_SUPPORT_conditional_enableif 
           78  +        #define CXXO_COMPILER_SUPPORT_conditional_enableif 1
    77     79           #undef  CXXO_COMPILER_SUPPORT_default_delete
    78     80           #define CXXO_COMPILER_SUPPORT_default_delete 1
    79     81           #undef  CXXO_COMPILER_SUPPORT_enum_class
    80     82           #define CXXO_COMPILER_SUPPORT_enum_class 1
    81     83           #undef  CXXO_COMPILER_SUPPORT_rvref
    82     84           #define CXXO_COMPILER_SUPPORT_rvref 1
    83     85           #undef  CXXO_COMPILER_SUPPORT_static_assert
................................................................................
    87     89           //#define CXXO_COMPILER_SUPPORT_std_iterator_helpers 1
    88     90           #define CXXO_COMPILER_SUPPORT_std_metaprogramming_helpers 1
    89     91           #undef  CXXO_COMPILER_SUPPORT_unique_ptr
    90     92           #define CXXO_COMPILER_SUPPORT_unique_ptr 1
    91     93           #undef  CXXO_COMPILER_SUPPORT_variadic
    92     94           #define CXXO_COMPILER_SUPPORT_variadic 1
    93     95       #else
           96  +        #undef  CXXO_COMPILER_SUPPORT_tr1_random
           97  +        #undef  CXXO_COMPILER_SUPPORT_tr1_tuple
           98  +        #define CXXO_COMPILER_SUPPORT_tr1_random 1
           99  +        #define CXXO_COMPILER_SUPPORT_tr1_tuple 1
    94    100           
    95    101       #endif
    96    102   #endif
    97    103   #if (CXXOMFORT_COMPILER_VERSION >= 406)
    98    104       #if defined(__GXX_EXPERIMENTAL_CXX0X__)
    99    105           #undef  CXXOMFORT_CXX_EMULATION
   100    106           #define CXXOMFORT_CXX_EMULATION 2011
   101    107           #undef  CXXO_COMPILER_SUPPORT_alignof
   102    108           #define CXXO_COMPILER_SUPPORT_alignof 1
   103    109           #undef  CXXO_COMPILER_SUPPORT_auto
   104    110           #define CXXO_COMPILER_SUPPORT_auto 1
          111  +        #undef  CXXO_COMPILER_SUPPORT_conditional_enableif 
          112  +        #define CXXO_COMPILER_SUPPORT_conditional_enableif 1
   105    113           #undef  CXXO_COMPILER_SUPPORT_default_delete
   106    114           #define CXXO_COMPILER_SUPPORT_default_delete 1
   107    115           #undef  CXXO_COMPILER_SUPPORT_enum_class
   108    116           #define CXXO_COMPILER_SUPPORT_enum_class 1
   109    117           #undef  CXXO_COMPILER_SUPPORT_explicit_operator
   110    118           #define CXXO_COMPILER_SUPPORT_explicit_operator 1
   111    119           #undef  CXXO_COMPILER_SUPPORT_foreach
................................................................................
   136    144           #undef  CXXO_COMPILER_SUPPORT_variadic
   137    145           #define CXXO_COMPILER_SUPPORT_variadic 1
   138    146       #else
   139    147           #undef  CXXO_COMPILER_SUPPORT_tr1_random
   140    148           #define CXXO_COMPILER_SUPPORT_tr1_random 1
   141    149           #undef  CXXO_COMPILER_SUPPORT_tr1_type_traits
   142    150           #define CXXO_COMPILER_SUPPORT_tr1_type_traits 1
          151  +        #undef  CXXO_COMPILER_SUPPORT_tr1_tuple
          152  +        #define CXXO_COMPILER_SUPPORT_tr1_tuple 1
   143    153       #endif
   144    154   #endif
   145    155   
   146    156   #if (CXXOMFORT_COMPILER_VERSION >= 407)
   147    157       #if defined(__GXX_EXPERIMENTAL_CXX0X__)
   148    158           #undef  CXXO_COMPILER_SUPPORT_constexpr
   149    159           #define CXXO_COMPILER_SUPPORT_constexpr 1

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

    43     43   #if (CXXOMFORT_COMPILER_VERSION <= 120)
    44     44       #error "cxxomfort -- Detected an horribly broken compiler! (MSVC6 or earlier)"
    45     45   #endif
    46     46   
    47     47   #if (CXXOMFORT_COMPILER_VERSION > 120)
    48     48       #undef  CXXO_COMPILER_SUPPORT_va_args
    49     49       #define CXXO_COMPILER_SUPPORT_va_args 1
           50  +    #undef  CXXO_COMPILER_SUPPORT_tr1_tuple 
           51  +    #define CXXO_COMPILER_SUPPORT_tr1_tuple 1
    50     52   #endif
    51     53   
    52     54   #if (CXXOMFORT_COMPILER_VERSION >= 160) // VC10 or higher
    53     55       #undef  CXXOMFORT_CXX_EMULATION
    54     56       #define CXXOMFORT_CXX_EMULATION 2011
    55     57       #undef  CXXO_COMPILER_SUPPORT_auto
    56     58       #define CXXO_COMPILER_SUPPORT_auto 1
................................................................................
    96     98       #define CXXO_COMPILER_SUPPORT_constexpr 1
    97     99       #undef  CXXO_COMPILER_SUPPORT_explicit_operator
    98    100       #define CXXO_COMPILER_SUPPORT_explicit_operator 1
    99    101       #undef  CXXO_COMPILER_SUPPORT_integer_sequence
   100    102       #define CXXO_COMPILER_SUPPORT_integer_sequence 1
   101    103       #undef  CXXO_COMPILER_SUPPORT_variadic
   102    104       #define CXXO_COMPILER_SUPPORT_variadic 1
   103         -    
   104         -    
   105         -    
   106    105   
   107    106   #endif
   108    107   
   109    108   
   110    109   // -- END Microsoft C++ Compiler --
   111    110   #endif

Changes to cxxomfort/cxxomfort/functional.hpp.

    21     21   
    22     22   // The bit_and and sibling functors from <functional> are missing in MSVC 2008
    23     23   #if (CXXOMFORT_COMPILER_ID == CXXO_VALUE_COMPILER_MSC && CXXOMFORT_COMPILER_VERSION <= 150)
    24     24       #include "impl/03-functional_bit.hpp"
    25     25   #endif
    26     26   
    27     27   namespace cxxomfort {
    28         -//! @brief Components related to <functional>
    29         -namespace functional {
           28  +namespace cxxostd {
    30     29   }
    31     30   }
    32     31   
    33     32   
    34     33   #include "./impl/14-functional-transparent.hpp"
    35     34   //#include "./impl/17-notfn.hpp"
    36     35   //#include "./impl/03-restore_binders.hpp"
    37     36   
    38     37   #endif

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

     5      5    */
     6      6   
     7      7   #include "../base.hpp"
     8      8   //#include CXXO_INCLUDE_SYS(random)
     9      9   
    10     10   // fix renamed functors in <random> between C++03 TR1 and C++11
    11     11   #if ((CXXOMFORT_CXX_STD < 2011) && (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC||CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_CLANG))
           12  +#if !defined(__GXX_EXPERIMENTAL_CXX0X__)
    12     13   namespace std {
    13     14   namespace tr1 {
    14     15   
    15     16   // These are only "good enough to work" fixes.
    16     17   
    17     18   //! @ingroup cxx11-backports
    18     19   template <typename II, II _w, II _s, II _r>
................................................................................
    44     45       : uniform_real<Real>(a,b) {}
    45     46   };
    46     47   
    47     48   
    48     49   } // namespace tr1
    49     50   } // namespace std
    50     51   
           52  +#endif // c++0x emulation
    51     53   #endif // fix
    52     54   #endif

Added cxxomfort/cxxomfort/impl/11-minmax.hpp.

            1  +#ifndef CXXOMFORT_IMPL_MINMAX_HPP
            2  +#define CXXOMFORT_IMPL_MINMAX_HPP
            3  +/**
            4  + * @file
            5  + */
            6  +
            7  +#include <cxxomfort/config.hpp>
            8  +
            9  +namespace cxxomfort {
           10  +namespace algorithm {
           11  +
           12  +/**
           13  + * @ingroup algorithm
           14  + * @ingroup cxx11-backports
           15  + * @sa n2569
           16  + * @{
           17  + */
           18  +
           19  +//
           20  +// minmax, minmax_element
           21  +//
           22  +
           23  +//! return a <code>pair(min,max)</code> from two arguments and a comparator @a Less .
           24  +template <typename T, typename Comparator>
           25  +std::pair<T const&, T const&> minmax (T const& a, T const& b, Comparator Less) {
           26  +    return Less(b,a) ? 
           27  +    std::pair<T const&, T const&>(b, a) : std::pair<T const&, T const&>(a, b)
           28  +    ;
           29  +}
           30  +
           31  +//! @overload minmax
           32  +template <typename T>
           33  +std::pair<T const&, T const&> minmax (T const& a, T const& b)  {
           34  +    return (b < a) ? 
           35  +    std::pair<T const&,T const&>(b, a) : std::pair<T const&,T const&>(a, b)
           36  +    ;
           37  +}
           38  +
           39  +//! Returns the pair (minimum,maximum) for the given sequence and comparator @p less .
           40  +template <typename FIterator, typename Comparator>
           41  +std::pair<FIterator,FIterator> 
           42  +minmax_element (FIterator ini, FIterator fin, Comparator less) {
           43  +    std::pair<FIterator, FIterator> result(ini, fin);
           44  + 
           45  +    if (ini == fin) return result;
           46  +    if (++ini == fin) return result;
           47  +
           48  +    if (less(*ini, *result.ini)) {
           49  +        result.second = result.ini;
           50  +        result.ini = ini;
           51  +    } else {
           52  +        result.second = ini;
           53  +    }
           54  +    while (++ini != fin) {
           55  +        FIterator i = ini;
           56  +        if (++ini == fin) {
           57  +            if (less(*i, *result.ini)) result.ini = i;
           58  +            else if (!(less(*i, *result.second))) result.second = i;
           59  +            break;
           60  +        } else {
           61  +            if (less(*ini, *i)) {
           62  +                if (less(*ini, *result.ini)) result.ini = ini;
           63  +                if (!(less(*i, *result.second))) result.second = i;
           64  +            } else {
           65  +                if (less(*i, *result.ini)) result.ini = i;
           66  +                if (!(less(*ini, *result.second))) result.second = ini;
           67  +            }
           68  +        }
           69  +    }
           70  +    return result;
           71  +
           72  +}
           73  +
           74  +//! @overload minmax_element
           75  +template <typename FIterator>
           76  +std::pair<FIterator,FIterator> 
           77  +minmax_element (FIterator ini, FIterator fin) {
           78  +    std::less <typename std::iterator_traits<FIterator>::value_type> less;
           79  +    return minmax_element(ini, fin, less);
           80  +}
           81  +
           82  +/**
           83  + * @}
           84  + */
           85  +
           86  +} // cxxomfort::algorithm
           87  +} // cxxomfort
           88  +
           89  +
           90  +#if (!defined(CXXOMFORT_NO_STD_USING))
           91  +#if (CXXOMFORT_CXX_STD < 2011)
           92  +    #if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC && CXXOMFORT_COMPILER_VERSION >=404 && CXXOMFORT_COMPILER_VERSION < 600 && CXXOMFORT_CXX_EMULATION==2011 )
           93  +    // GCC already has defined these in 4.4-4.6 c++0x mode
           94  +    #else
           95  +namespace std {
           96  +    using ::cxxomfort::algorithm::minmax;
           97  +    using ::cxxomfort::algorithm::minmax_element;
           98  +}
           99  +
          100  +    #endif
          101  +
          102  +#endif // c++11
          103  +#endif // no-using
          104  +#endif
          105  +

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

    66     66   
    67     67   //
    68     68   // MSVC 2010 implements incorrect to_string, with only three overloads
    69     69   // https://stackoverflow.com/questions/10664699/stdto-string-more-than-instance-of-overloaded-function-matches-the-argument
    70     70   //
    71     71   
    72     72   namespace cxxomfort {
    73         -namespace string {
           73  +namespace cxxostd {
    74     74   
    75     75   namespace detail_string {
    76     76   
    77     77   template <typename T> struct printfmask {};
    78     78   
    79     79   template <> struct printfmask<signed int> {
    80     80       static char const * /*const*/ mask () { return "%d"; };
................................................................................
   210    210   
   211    211       size_t* _p;
   212    212       const int _b;
   213    213       convertfn _pfn;
   214    214   };
   215    215   
   216    216   
   217         -} //cxxomfort::string::detail_string
          217  +} //cxxomfort::cxxostd::detail_string
   218    218   
   219    219   
   220    220   /**
   221    221    * @brief Returns a @c string expression of an integral.
   222    222    * @ingroup cxx11-backports
   223    223    */
   224    224   static inline std::string to_string (unsigned short u) {
................................................................................
   297    297   //    return strtoll (str.c_str(), pinv, base);
   298    298   }
   299    299   
   300    300   /**
   301    301    * @}
   302    302    */
   303    303   
   304         -} //~namespace string
          304  +} //~namespace cxxostd
   305    305   } //~namespace cxxomfort
   306    306   
   307    307   
   308    308   #if (CXXOMFORT_CXX_STD >= 2011)
   309    309   #elif (CXXOMFORT_CXX_EMULATION==0)
   310    310   namespace std {
   311    311   
   312    312       //! using to_string (backport to c++03)
   313    313       //! @ref cxx03-backports
   314         -    using ::cxxomfort::string::to_string;
          314  +    using ::cxxomfort::cxxostd::to_string;
   315    315   
   316         -    using ::cxxomfort::string::stoul;
   317         -    using ::cxxomfort::string::stol;
   318         -    using ::cxxomfort::string::stoull;
   319         -    using ::cxxomfort::string::stoll;
          316  +    using ::cxxomfort::cxxostd::stoul;
          317  +    using ::cxxomfort::cxxostd::stol;
          318  +    using ::cxxomfort::cxxostd::stoull;
          319  +    using ::cxxomfort::cxxostd::stoll;
   320    320   }
   321    321   #elif (CXXOMFORT_CXX_EMULATION>0)
   322    322   namespace std {
   323    323       // GCC already brings those names
   324    324       #if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC)
   325    325       // MSC brings some of them
   326    326       #elif (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_MSC)
   327    327           #if (CXXOMFORT_COMPILER_VERSION==160)
   328    328           // MSVC 2010 has failing overloads for to_string
   329    329               #if (CXXOMFORT_NOTICES > 2)
   330    330                   #pragma message CXXO_NOTICE("adding missing overloads to to_string")
   331    331               #endif
   332         -        using ::cxxomfort::string::to_string;
          332  +        using ::cxxomfort::cxxostd::to_string;
   333    333       // MSVC 2010 already has stol, stoul, but lacks the long long versions
   334    334           #elif (CXXOMFORT_COMPILER_VERSION < 160)
   335         -        using ::cxxomfort::string::stol;
   336         -        using ::cxxomfort::string::stoul;
   337         -        using ::cxxomfort::string::to_string;
          335  +        using ::cxxomfort::cxxostd::stol;
          336  +        using ::cxxomfort::cxxostd::stoul;
          337  +        using ::cxxomfort::cxxostd::to_string;
   338    338           #endif
   339         -    using ::cxxomfort::string::stoll;
   340         -    using ::cxxomfort::string::stoull;
          339  +    using ::cxxomfort::cxxostd::stoll;
          340  +    using ::cxxomfort::cxxostd::stoull;
   341    341       #endif
   342    342   }
   343    343   #endif // (c++11)
   344    344   
   345    345   #endif
   346    346   
   347    347   #endif

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

    35     35   #endif
    36     36   
    37     37   #include <type_traits> // common_type
    38     38   #include "../type_traits.hpp"
    39     39   #include "../util/traits_ct.hpp"
    40     40   
    41     41   namespace cxxomfort {
    42         -namespace functional {
           42  +namespace cxxostd {
    43     43   
    44     44   /**
    45     45    * @ingroup cxx14-backports
    46     46    * @{
    47     47    */
    48     48   template <typename T = void> struct less 
    49     49   : std::less<T> {};
................................................................................
   175    175   #undef LPP_SPEC_FUNCTIONAL_VOID
   176    176   
   177    177   
   178    178   /**
   179    179    * @}
   180    180    */
   181    181   
   182         -} //cxxomfort::extras
          182  +} //cxxomfort::cxxostd
   183    183   } //cxxomfort
   184    184   
   185    185   // for the facilities to function correctly they are rebuilt in 
   186    186   // namespace std; but we give users the option not to.
   187    187   #if (!defined(CXXOMFORT_NO_STD_USING))
   188    188   /*
   189    189    * Transparent functors were established in C++14
   190    190    */
   191    191   #if (CXXOMFORT_CXX_STD < 2014)
   192    192   namespace std {
   193    193   
   194    194       //! Transparent @em equal_to functor.
   195         -    template<> struct equal_to<void>  : ::cxxomfort::functional::equal_to<void> {}; ///< transparent specialization for @c std::equal_to
          195  +    template<> struct equal_to<void>  : ::cxxomfort::cxxostd::equal_to<void> {}; ///< transparent specialization for @c std::equal_to
   196    196       //! Transparent @em not_equal_to functor.
   197         -    template<> struct not_equal_to<void>  : ::cxxomfort::functional::not_equal_to<void> {};
          197  +    template<> struct not_equal_to<void>  : ::cxxomfort::cxxostd::not_equal_to<void> {};
   198    198       //! Transparent @em less functor.
   199         -    template<> struct less<void>      : ::cxxomfort::functional::less<void> {};
          199  +    template<> struct less<void>      : ::cxxomfort::cxxostd::less<void> {};
   200    200       //! Transparent @em greater functor.
   201         -    template<> struct greater<void>   : ::cxxomfort::functional::greater<void> {};
          201  +    template<> struct greater<void>   : ::cxxomfort::cxxostd::greater<void> {};
   202    202       //! Transparent @em less_equal functor.
   203         -    template<> struct less_equal<void>    : ::cxxomfort::functional::less_equal<void> {};
          203  +    template<> struct less_equal<void>    : ::cxxomfort::cxxostd::less_equal<void> {};
   204    204       //! Transparent @em greater_equal functor.
   205         -    template<> struct greater_equal<void> : ::cxxomfort::functional::greater_equal<void> {};
          205  +    template<> struct greater_equal<void> : ::cxxomfort::cxxostd::greater_equal<void> {};
   206    206       //! Transparent @em bit_or functor.
   207         -    template<> struct bit_or<void>    : ::cxxomfort::functional::bit_or<void> {};
          207  +    template<> struct bit_or<void>    : ::cxxomfort::cxxostd::bit_or<void> {};
   208    208       //! Transparent @em bit_and functor.
   209         -    template<> struct bit_and<void>   : ::cxxomfort::functional::bit_and<void> {};
          209  +    template<> struct bit_and<void>   : ::cxxomfort::cxxostd::bit_and<void> {};
   210    210       //! Transparent @em bit_xor functor.
   211         -    template<> struct bit_xor<void>   : ::cxxomfort::functional::bit_xor<void> {};
          211  +    template<> struct bit_xor<void>   : ::cxxomfort::cxxostd::bit_xor<void> {};
   212    212   
   213    213       //! Transparent @em plus functor.
   214         -    template<> struct plus<void>   : ::cxxomfort::functional::plus<void> {}; ///< transparent specialization for @c std::plus
          214  +    template<> struct plus<void>   : ::cxxomfort::cxxostd::plus<void> {}; ///< transparent specialization for @c std::plus
   215    215       //! Transparent @em minus functor.
   216         -    template<> struct minus<void>   : ::cxxomfort::functional::minus<void> {};
          216  +    template<> struct minus<void>   : ::cxxomfort::cxxostd::minus<void> {};
   217    217       //! Transparent @em multiplies functor.
   218         -    template<> struct multiplies<void>   : ::cxxomfort::functional::multiplies<void> {};
          218  +    template<> struct multiplies<void>   : ::cxxomfort::cxxostd::multiplies<void> {};
   219    219       //! Transparent @em divides functor.
   220         -    template<> struct divides<void>   : ::cxxomfort::functional::divides<void> {};
          220  +    template<> struct divides<void>   : ::cxxomfort::cxxostd::divides<void> {};
   221    221       //! Transparent @em modulus functor.
   222         -    template<> struct modulus<void>   : ::cxxomfort::functional::modulus<void> {};
          222  +    template<> struct modulus<void>   : ::cxxomfort::cxxostd::modulus<void> {};
   223    223   
   224    224   }
   225    225   #endif // c++14
   226    226   #endif // no std
   227    227   
   228    228   #endif // CXXOMFORT_EXTRAS_14FUNCTORS_HPP

Added cxxomfort/cxxomfort/impl/17-bool_constant.hpp.

            1  +#ifndef CXXOMFORT_IMPL_17_BOOLEANCONSTANT_HPP
            2  +#define CXXOMFORT_IMPL_17_BOOLEANCONSTANT_HPP
            3  +/**
            4  + * @file
            5  + */
            6  +
            7  +/*
            8  + * 
            9  + * * std::boolean_constant
           10  + * 
           11  + */
           12  +
           13  +#include <cxxomfort/base.hpp>
           14  +#include <type_traits>
           15  +#include <tuple>
           16  +
           17  +#if (defined(CXXOMFORT_NOTICES))
           18  +    #if (CXXOMFORT_NOTICES > 2)
           19  +    #pragma message CXXO_NOTICE("enabled boolean_constant implementation")
           20  +    #endif
           21  +#endif
           22  +
           23  +
           24  +namespace cxxomfort {
           25  +namespace type_traits {
           26  +
           27  +#if (CXXOMFORT_CXX_STD<2014)
           28  +template <bool B>
           29  +struct bool_constant 
           30  +: std::integral_constant<bool,B> {};
           31  +
           32  +#else
           33  +template <bool B>
           34  +using bool_constant = std::integral_constant<bool,B>;
           35  +
           36  +#endif
           37  +
           38  +}
           39  +}
           40  +
           41  +#if (CXXOMFORT_CXX_STD < 2017)
           42  +namespace std {
           43  +    using ::cxxomfort::type_traits::bool_constant;
           44  +}
           45  +#endif
           46  +
           47  +#endif
           48  +
           49  +
           50  +

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

    29     29   // -----
    30     30   
    31     31   #if (defined(CXXOMFORT_USING_stdbyte))
    32     32   
    33     33   #include "../library/typesafe_enum.hpp"
    34     34   
    35     35   namespace cxxomfort {
    36         -namespace cstddef {
           36  +namespace cxxostd {
    37     37   
    38     38   namespace detail { // detail
    39     39   
    40     40   struct mybyte_def { enum type {};  };
    41         -typedef typesafe_enum<mybyte_def,unsigned char> byteimpl;
           41  +typedef cxxomfort::library::typesafe_enum<mybyte_def,unsigned char> byteimpl;
    42     42   // quick and easy encapsulation
    43     43   
    44     44   }
    45     45   
    46     46   /**
    47     47    * @brief "byte" type for C++17.
    48     48    * @ingroup cxx17-backports
................................................................................
    72     72    */
    73     73   struct byte: protected detail::byteimpl  {
    74     74       private:
    75     75       typedef detail::byteimpl underlying_t;
    76     76       public:
    77     77       
    78     78       byte (byte const& b) : detail::byteimpl((detail::byteimpl const&)b) {}
    79         -    explicit byte (unsigned char c) : detail::byteimpl( from_underlying<detail::byteimpl>(c) ) {}
           79  +    explicit byte (unsigned char c) : detail::byteimpl( library::from_underlying<detail::byteimpl>(c) ) {}
    80     80   
    81     81       //using byteimpl::byteimpl;
    82     82       using detail::byteimpl::underlying;
    83     83       //using detail::byteimpl::operator=;
    84     84       using detail::byteimpl::equals;
    85     85   
    86     86       byte& operator= (byte const& b) CXXO_NOEXCEPT {
................................................................................
   181    181   }
   182    182   // cxxomfort
   183    183   }
   184    184   
   185    185   #if (!defined(CXXOMFORT_NO_STD_USING))
   186    186   namespace std {
   187    187       //! @ref cxx17-backports
   188         -    using cxxomfort::cstddef::byte;
   189         -    using cxxomfort::cstddef::to_byte;
   190         -    using cxxomfort::cstddef::to_integer;
          188  +    using cxxomfort::cxxostd::byte;
          189  +    using cxxomfort::cxxostd::to_byte;
          190  +    using cxxomfort::cxxostd::to_integer;
   191    191   }
   192    192   #endif
   193    193   
   194    194   #endif // stdbyte
   195    195   
   196    196   #if (defined(DOXYGEN_DOC))
   197    197   namespace std {
   198    198       //! byte object representation
   199    199       struct byte {};
   200    200   }
   201    201   #endif
   202    202   
   203    203   #endif

Deleted cxxomfort/cxxomfort/impl/17-endian.hpp.


Added cxxomfort/cxxomfort/impl/17-size.hpp.

            1  +#ifndef CXXOMFORT_IMPL_17_SIZE_HPP
            2  +#define CXXOMFORT_IMPL_17_SIZE_HPP
            3  +
            4  +#include <cxxomfort/config.hpp>
            5  +
            6  +// TODO fix "size" for compatibility with C++17's name
            7  +//
            8  +// From proposal N4017
            9  +//
           10  +// This implements a nonmember size() that calls member .size().
           11  +// For containers that somehow don't have size() (looking at you forward_list >_>)
           12  +// let's do distance(.begin(),.end())
           13  +
           14  +namespace cxxomfort {
           15  +namespace cxxostd {
           16  +namespace iterator {
           17  +
           18  +namespace detail_size {
           19  +template <typename C, bool F=false> struct call_size_has {
           20  +    typename C::difference_type operator() (C const& c) const { 
           21  +        return std::distance(c.begin() , c.end());
           22  +    }
           23  +}; // call_size_has
           24  +
           25  +template <typename C> struct call_size_has<C,true> {
           26  +    typename C::difference_type operator() (C const& c) const { 
           27  +        return c.size();
           28  +    }
           29  +}; // call_size_has
           30  +
           31  +} // detail_size
           32  +
           33  +template <typename C> inline
           34  +typename C::difference_type
           35  +size (C & c) {
           36  +    typedef typename C::iterator iterator;
           37  +    (void)iterator();
           38  +    typedef typename C::difference_type difference_type;
           39  +    (void)difference_type();
           40  +    typedef typename C::value_type value_type;
           41  +    (void)value_type();
           42  +    const detail_size::call_size_has< C, ::cxxomfort::iterator::iterator_accessors_helper<C>::has_size > s={};
           43  +    return s(c);
           44  +}
           45  +
           46  +// overload for native arrays
           47  +template <typename T, size_t N> inline
           48  +size_t size (T(&arr)[N]) {
           49  +    (void)arr;
           50  +    return N;
           51  +}
           52  +
           53  +}}}
           54  +
           55  +#if (CXXOMFORT_CXX_STD < 2017)
           56  +namespace std {
           57  +	using ::cxxomfort::cxxostd::iterator::size;
           58  +}
           59  +#endif
           60  +
           61  +#endif

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

            1  +#ifndef CXXOMFORT_IMPL_20_ENDIAN_HPP
            2  +#define CXXOMFORT_IMPL_20_ENDIAN_HPP
            3  +
            4  +#include <cxxomfort/config.hpp>
            5  +#include <cxxomfort/library/typesafe_enum.hpp>
            6  +
            7  +namespace cxxomfort {
            8  +namespace std {
            9  +
           10  +//struct myenum_def { enum type { member1, member2, member3 }; };
           11  +//typedef typesafe_enum<myenum_def> myenum;
           12  +
           13  +namespace detail_endian {
           14  +
           15  +struct e_ { enum type { 
           16  +#if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_MSC || defined(_WIN32))
           17  +    little = 0,
           18  +    big = 1,
           19  +    native = little
           20  +#else
           21  +    little = __ORDER_LITTLE_ENDIAN__,
           22  +    big    = __ORDER_BIG_ENDIAN__,
           23  +    native = __BYTE_ORDER__
           24  +#endif
           25  +}; // enum 
           26  +}; // struct
           27  +} // detail_endian
           28  +
           29  +typedef cxxomfort::library::typesafe_enum<detail_endian::e_> endian;
           30  +
           31  +}} // cxxomfort::std
           32  +
           33  +#if (CXXO_COMPILER_SUPPORT_endian)
           34  +#else
           35  +namespace std { using cxxomfort::std::endian;
           36  +}
           37  +
           38  +#endif
           39  +
           40  +#endif

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

            1  +#ifndef CXXOMFORT_IMPL_20_IDENTITY_FINALLY_HPP
            2  +#define CXXOMFORT_IMPL_20_IDENTITY_FINALLY_HPP
            3  +
            4  +#include <cxxomfort/config.hpp>
            5  +#include <cxxomfort/library/typesafe_enum.hpp>
            6  +
            7  +// https://en.cppreference.com/w/cpp/types/type_identity
            8  +
            9  +namespace cxxomfort {
           10  +namespace std {
           11  +
           12  +template <typename T> struct type_identity { typedef T type; };
           13  +
           14  +}} // cxxomfort::std
           15  +
           16  +#if (CXXOMFORT_CXX_STD<2020 && CXXOMFORT_CXX_EMULATION<2020)
           17  +namespace std { using cxxomfort::std::type_identity; }
           18  +
           19  +#else
           20  +
           21  +#endif
           22  +
           23  +#endif

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

    11     11   //#include <functional>
    12     12   #include <cxxomfort/config.hpp>
    13     13   #include <cxxomfort/base/iterator.hpp> // global begin, end
    14     14   #include <cxxomfort/util/meta.hpp>
    15     15   #include <valarray>
    16     16   
    17     17   namespace cxxomfort {
           18  +namespace library {
    18     19   namespace detail {
    19     20   
    20     21   ///////////////////////////////////////////////////////////////////////////////
    21     22   // auto_any
    22     23   
    23     24   struct auto_any_base {
    24     25       operator bool() const { return false; }
................................................................................
   125    126       typedef typename type2iterator<T>::iterator iter_type;
   126    127       //typedef typename T::const_iterator iter_type;
   127    128       return *auto_any_cast<iter_type>(cur);
   128    129   }
   129    130   
   130    131   
   131    132   } // detail::
   132         -}
   133    133   
   134    134   ///////////////////////////////////////////////////////////////////////////////
   135    135   // FOREACH
   136         -
   137    136   
   138    137   
   139    138   #if defined(_MSC_VER)
   140    139   // use a modified version with pragmas to suppress
   141    140   // "assignment within conditional" warnings
   142    141   #define CXXO_FOREACH(item, container)                  \
   143    142   __pragma(warning(suppress:4706)) __pragma(warning(suppress:6001)) \
   144         -if(::cxxomfort::detail::auto_any_base const& bX = ::cxxomfort::detail::begin(container)) {} else   \
   145         -if(::cxxomfort::detail::auto_any_base const& eX = ::cxxomfort::detail::end(container)) {} else     \
          143  +if(::cxxomfort::library::detail::auto_any_base const& bX = ::cxxomfort::library::detail::begin(container)) {} else   \
          144  +if(::cxxomfort::library::detail::auto_any_base const& eX = ::cxxomfort::library::detail::end(container)) {} else     \
   146    145   for(bool more = true;                                   \
   147         -    more && !::cxxomfort::detail::done(bX,eX,ENCODED_TYPEOF(container));                       \
   148         -    more ? ::cxxomfort::detail::next(bX,ENCODED_TYPEOF(container)) : (void)0)                 \
          146  +    more && !::cxxomfort::library::detail::done(bX,eX,ENCODED_TYPEOF(container));                       \
          147  +    more ? ::cxxomfort::library::detail::next(bX,ENCODED_TYPEOF(container)) : (void)0)                 \
   149    148       __pragma(warning(suppress:4706))                       \
   150    149       if ((more = false)!=0) {} else                           \
   151         -    for(item = ::cxxomfort::detail::deref(bX,ENCODED_TYPEOF(container)); !more; more = true)
          150  +    for(item = ::cxxomfort::library::detail::deref(bX,ENCODED_TYPEOF(container)); !more; more = true)
   152    151   
   153    152   #else
   154    153   // all other compilers
   155    154   #define CXXO_FOREACH(item, container)                  \
   156         -if(::cxxomfort::detail::auto_any_base const& bX = ::cxxomfort::detail::begin(container)) {} else   \
   157         -if(::cxxomfort::detail::auto_any_base const& eX = ::cxxomfort::detail::end(container)) {} else     \
          155  +if(::cxxomfort::library::detail::auto_any_base const& bX = ::cxxomfort::library::detail::begin(container)) {} else   \
          156  +if(::cxxomfort::library::detail::auto_any_base const& eX = ::cxxomfort::library::detail::end(container)) {} else     \
   158    157   for(bool more = true;                                   \
   159         -    more && !::cxxomfort::detail::done(bX,eX,ENCODED_TYPEOF(container));                       \
   160         -    more ? ::cxxomfort::detail::next(bX,ENCODED_TYPEOF(container)) : (void)0)                 \
          158  +    more && !::cxxomfort::library::detail::done(bX,eX,ENCODED_TYPEOF(container));                       \
          159  +    more ? ::cxxomfort::library::detail::next(bX,ENCODED_TYPEOF(container)) : (void)0)                 \
   161    160       if ((more = false)!=0) {} else                           \
   162         -    for(item = ::cxxomfort::detail::deref(bX,ENCODED_TYPEOF(container)); !more; more = true)
          161  +    for(item = ::cxxomfort::library::detail::deref(bX,ENCODED_TYPEOF(container)); !more; more = true)
   163    162   
   164    163   #endif // foreach macro definition
   165    164   
   166    165   #undef Suppress_
   167    166   

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

    12     12   #include <cxxomfort/config.hpp>
    13     13   #include <cxxomfort/base/iterator.hpp> // global begin, end
    14     14   #include <cxxomfort/util/type_traits.hpp>
    15     15   #include <cxxomfort/util/meta.hpp>
    16     16   //#include <cxxomfort/memory.hpp> // alignof, aligned_storage
    17     17   
    18     18   namespace cxxomfort {
    19         -namespace extras {
           19  +namespace library {
    20     20   
    21     21   struct seq2iter_base {
    22     22       operator bool () const { return false; }
    23     23   };
    24     24   
    25     25   template <typename T, bool B=false>
    26     26   struct seq2iter_impl {
................................................................................
    55     55       : _i(i) {}
    56     56       
    57     57   };
    58     58   
    59     59   // for compilers that support __typeof__
    60     60   
    61     61   #define CXXO_FOREACH(item,container)    \
    62         -if (::cxxomfort::extras::seq2iter< __typeof__(container) > const& bX = ::std::begin(container)) {} else \
    63         -if (::cxxomfort::extras::seq2iter< __typeof__(container) > const& eX = ::std::end(container))   {} else \
           62  +if (::cxxomfort::library::seq2iter< __typeof__(container) > const& bX = ::std::begin(container)) {} else \
           63  +if (::cxxomfort::library::seq2iter< __typeof__(container) > const& eX = ::std::end(container))   {} else \
    64     64   for (bool more=true; more && (bX._i != eX._i)                                     \
    65     65       ; more ? (void)++bX._i : (void)0 )                                               \
    66     66       if ((more=false)!=0) {} else                                            \
    67     67       for( item = *bX._i; !more; more=true)
    68     68   
    69     69   
    70     70   }
    71     71   }
    72     72   

Changes to cxxomfort/cxxomfort/impl/to_basic_string_cxx03.hpp.

     1      1   #ifndef CXXOMFORT_IMPL_TO_BASIC_STRING_03_HPP
     2      2   #define CXXOMFORT_IMPL_TO_BASIC_STRING_03_HPP
     3      3   
     4      4   
     5      5   //#include "../extras/optional.hpp"
     6      6   
     7         -namespace cxxomfort {
            7  +namespace cxxomfort { namespace library {
     8      8   namespace string {
            9  +
     9     10   namespace detail_string {
    10     11   
    11     12   const struct no_t {
    12     13       template <typename Ch, typename Tr, typename Alloc>
    13     14       friend std::basic_ostringstream<Ch,Tr,Alloc>& 
    14     15       operator<< (std::basic_ostringstream<Ch,Tr,Alloc>& os, no_t const& n) {
    15     16           (void)n;
    16     17           return os;
    17     18   }
    18     19   
    19     20   } noitem = {};
    20     21   
    21     22   
    22         -template <
    23         -typename Stream
    24         ->
           23  +template <typename Stream>
    25     24   struct streamizer {
    26     25       streamizer (Stream& s)
    27     26       : stream(s) 
    28     27       {
    29     28           using namespace std;
    30     29           stream.exceptions(ios_base::failbit | ios_base::badbit);
    31     30       }
................................................................................
    37     36       }
    38     37   
    39     38       Stream& stream;
    40     39       
    41     40   };
    42     41   
    43     42   
    44         -} // cxxomfort::string::detail_string
           43  +} // cxxomfort::library::string::detail_string
    45     44   
    46     45   
    47     46   template <typename Ch, typename Tr, typename Alloc
    48     47   , typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9
    49     48   >
    50     49   std::basic_string<Ch,Tr,Alloc> 
    51     50   to_basic_string
................................................................................
   345    344   template <typename T0, typename T1>
   346    345   std::string  to_string
   347    346   (T0 const& t0, T1 const& t1) {
   348    347       return to_basic_string_defaults<char>(t0,t1);
   349    348   }
   350    349   
   351    350   } // string
   352         -} // cxxomfort
          351  +}} // cxxomfort::library
   353    352   
   354    353   #endif

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

    29     29    * char_traits<Ch> and allocator<Ch> from that.
    30     30    * * in c++11 onwards, both functions are equivalent
    31     31    * 
    32     32    */
    33     33   
    34     34   #if (CXXOMFORT_CXX_STD >= 2011)
    35     35   
    36         -namespace cxxomfort {
           36  +namespace cxxomfort { namespace library {
    37     37   namespace string {
    38     38   
    39     39   template<class Ch, class Tr = std::char_traits<Ch>, class Alloc = std::allocator<Ch>, class... Args>
    40     40   std::basic_string<Ch,Tr,Alloc> 
    41     41   to_basic_string(Args&&... args)
    42     42   {
    43     43       using namespace std;
................................................................................
    71     71   {
    72     72       using std::forward;
    73     73       return to_basic_string<wchar_t>
    74     74       (forward<Args>(args)...);
    75     75   }
    76     76   
    77     77   } // cxxomfort::string
    78         -} // cxxomfort
           78  +} } // cxxomfort::library
    79     79   
    80     80   #else
    81     81   #include "to_basic_string_cxx03.hpp"
    82     82   #endif
    83     83   
    84     84   #if defined(DOXYGEN_DOC)
    85     85   

Changes to cxxomfort/cxxomfort/library/functionalfn.hpp.

     4      4   #include <cxxomfort/base.hpp>
     5      5   #include <functional>
     6      6   #include <iterator>
     7      7   
     8      8   #include "operatorit.hpp" // supplement operator functors
     9      9   
    10     10   namespace cxxomfort {
    11         -//! Namespace for the objects in @ref cxxo:sup:functional .
           11  +/**
           12  + * @namespace 
           13  + * @brief Supplements to functionality in <code><functional></code>.
           14  + * @ingroup cxxo:sup:functional
           15  + */
    12     16   namespace functional {
    13         -
    14     17   
    15     18   } // .functional:
    16     19   }
    17     20   
    18     21   /**
    19     22    * @page cxxo:sup:functional "Supplements to <functional>"
    20     23    * @brief Offers cxxomfort-specific supplements to <code><functional></code> features.

Changes to cxxomfort/cxxomfort/library/i12n.hpp.

    54     54       #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
    55     55       #pragma message CXXO_NOTICE ("enabled container initialization helper")
    56     56       #endif
    57     57   
    58     58   #include <iterator>
    59     59   #include <valarray>
    60     60   
    61         -namespace cxxomfort {
           61  +namespace cxxomfort { namespace library {
    62     62   namespace i12n_detail {
    63     63   
    64     64   template <typename Container> struct I12N_for {
    65     65       typename Container::value_type const* starter;
    66     66       typename Container::value_type const* ender;
    67     67       template <size_t N>
    68     68       explicit I12N_for (typename Container::value_type const (&arr)[N]) 
................................................................................
    78     78       explicit I12N_for (typename std::valarray<T>::value_type const (&arr)[N]) 
    79     79       : starter(arr), ender(N) { 
    80     80       }
    81     81   
    82     82   };
    83     83   
    84     84   }
    85         -}
           85  +} // library
           86  +} // cxxomfort
    86     87   
    87     88   
    88     89   #define CXXO_I12N_BEG(Type,Name) typedef std::remove_cv<Type>::type Name##0ncv; static const Name##0ncv::value_type Name##0init []
    89     90   #define CXXO_I12N_END(Type,Name) ; Type Name ((Name##0init), cxxomfort::i12n_detail::I12N_for< Name##0ncv >(Name##0init).ender)
    90     91   
    91     92   // If compiler supports variadic macros, this can be used:
    92     93   #if (CXXO_COMPILER_SUPPORT_va_args==1 )

Changes to cxxomfort/cxxomfort/library/operatorit.hpp.

    13     13    * * comma_it.
    14     14    * * 
    15     15    *
    16     16    */
    17     17   
    18     18   #include <cxxomfort/cxxomfort.hpp>
    19     19   #include CXXO_INCLUDE_SYS(functional)
           20  +#include <type_traits> // add_reference
    20     21   
    21     22   namespace cxxomfort {
    22         -
    23         -/**
    24         - * @namespace 
    25         - * @brief Supplements to functionality in <code><functional></code>.
    26         - * @ingroup cxxo:sup:functional
    27         - */
    28     23   namespace functional {
    29     24   
    30     25   /**
    31     26    * @ingroup cxxo:sup:functional 
    32     27    * @{
    33     28    */
    34     29   
           30  +//struct noop_t {
           31  +//    void operator() (...) const CXXO_NOEXCEPT {}
           32  +//};
           33  +
    35     34   /**
    36     35    * @brief Functoid that wraps <code>++t</code> for a given @a T .
    37     36    */
    38     37   template <typename T>
    39     38   struct preincrement
    40         -:std::unary_function<T,T> {
           39  +:std::unary_function< T&,T> {
    41     40       typedef T argument_type;
    42     41       typedef T result_type;
    43         -    T& operator() (T& t) const { ++t; return t; }
           42  +    T& operator() (T& t) const { return ++t; }
    44     43   };
    45     44   
    46     45   //! Heterogeneous (deduced) wrapper for @ref preincrement .
    47     46   template<> struct preincrement<void> {
    48     47       template <typename T>
    49         -    T& operator() (T& t) const { ++t; return t; }
           48  +    T& operator() (T& t) const { return ++t; }
    50     49   };
    51     50   
    52     51   /**
    53     52    * @brief Functoid that wraps <code>--t</code> for a given @a T .
    54     53    */
    55     54   template <typename T>
    56     55   struct predecrement
    57         -:std::unary_function<T,T> {
           56  +:std::unary_function< T&,T> {
    58     57       typedef T argument_type;
    59     58       typedef T result_type;
    60         -    T& operator() (T& t) const { --t; return t; }
           59  +    T& operator() (T& t) const { return --t; }
    61     60   };
    62     61   
    63     62   //! Heterogeneous (deduced) wrapper version of predecrement.
    64     63   template<> struct predecrement<void> {
    65     64       template <typename T>
    66         -    T& operator() (T& t) { --t; return t; }
           65  +    T& operator() (T& t) { return --t; }
    67     66   
    68     67   };
    69     68   
    70     69   
    71     70   #define CXXO_DEF_OPERATORIT(Name,Sym) \
    72     71   template <typename It, typename Ot=It> \
    73         -struct Name : plus<int> {              \
    74         -    typedef It result_type;            \
           72  +struct CXXOMFORT_JOIN(Name,_it) : std::binary_function< It& ,Ot const&,It&> {   \
    75     73       inline It& operator() (It& l, Ot const& r) const {   \
    76     74           return l Sym r;       \
    77     75       }                         \
    78     76   };                            \
    79     77   
    80         -
    81         -CXXO_DEF_OPERATORIT(plus_it,+=);
    82         -CXXO_DEF_OPERATORIT(minus_it,-=);
    83         -CXXO_DEF_OPERATORIT(multiplies_it,*=);
    84         -CXXO_DEF_OPERATORIT(divides_it,/=);
    85         -CXXO_DEF_OPERATORIT(modulus_it,%=);
    86         -CXXO_DEF_OPERATORIT(leftshift_it,<<=);
    87         -CXXO_DEF_OPERATORIT(rightshift_it,>>=);
           78  +//! plus_it: Named functor that wraps operator+= for types <A,B>.
           79  +CXXO_DEF_OPERATORIT(plus,+=);
           80  +//! minus_it: Named functor that wraps operator-= for types <A,B>.
           81  +CXXO_DEF_OPERATORIT(minus,-=);
           82  +//! multiplies_it: Named functor that wraps operator*= for types <A,B>.
           83  +CXXO_DEF_OPERATORIT(multiplies,*=);
           84  +//! divides_it: Named functor that wraps operator/= for types <A,B>.
           85  +CXXO_DEF_OPERATORIT(divides,/=);
           86  +//! modulus_it: Named functor that wraps operator%= for types <A,B>.
           87  +CXXO_DEF_OPERATORIT(modulus,%=);
    88     88   
    89     89   #undef CXXO_DEF_OPERATORIT
           90  +
           91  +// leftshift, rightshift are defined in terms of cxxomfort-operators
           92  +//CXXO_DEF_OPERATORIT(leftshift_it,<<=);
           93  +//CXXO_DEF_OPERATORIT(rightshift_it,>>=);
           94  +
           95  +template <typename It, typename Ot=It> 
           96  +struct leftshift_it : ::std::binary_function<It&,Ot const&,It&> {   
           97  +    inline It& operator() (It& l, Ot const& r) const { 
           98  +        return l<<=r;
           99  +    }
          100  +};
          101  +
          102  +template <typename It, typename Ot=It> 
          103  +struct rightshift_it : ::std::binary_function<It&,Ot const&,It&> {   
          104  +    inline It& operator() (It& l, Ot const& r) const { 
          105  +        return l>>=r;
          106  +    }
          107  +};
          108  +
    90    109   
    91    110   /**
    92    111    * @}
    93    112    */
    94    113   
    95    114   } // functional
    96    115   } // cxxomfort
    97    116   
    98    117   #endif
    99    118   

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

    50     50   /**
    51     51    * @brief Returns a string representation of an ASCII ordinal.
    52     52    * @return a 1-character string of type String.
    53     53    */
    54     54   template <typename String>
    55     55   String chr (uint16_t ascii) {
    56     56       if (ascii >= 0x100) throw std::out_of_range(
    57         -        cxxomfort::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
           57  +        cxxomfort::library::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
    58     58       );
    59     59       char q[]= "0";
    60     60       q[0]= ascii;
    61     61       return q;
    62     62   }
    63     63   
    64     64   
    65     65   // specialization for std::string and std::wstring using their special constructors.
    66     66   static inline std::string chr (uint16_t ascii) {
    67     67       if (ascii >= 0x100) throw std::out_of_range(
    68         -        cxxomfort::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
           68  +        cxxomfort::library::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
    69     69       );
    70     70       return std::string(1, static_cast<char>(ascii));
    71     71   }
    72     72   
    73         -static inline std::wstring wchr (uint16_t ascii) {
           73  +static inline std::wstring wchr (uint32_t ascii) {
    74     74       if (ascii >= 0x100) throw std::out_of_range(
    75         -        cxxomfort::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
           75  +        cxxomfort::library::string::to_string("cxxomfort::string::chr: ascii(", static_cast<uint16_t>(ascii), ") out of range")
    76     76       );
    77     77       return std::wstring(1, static_cast<wchar_t>(ascii));
    78     78   }
    79     79   
    80         -static std::string utf8chr (unsigned long cp) {
           80  +static inline std::string utf8chr (uint32_t cp) {
    81     81   	using namespace std;
    82     82   	char chu[5] = {0x00, 0x00, 0x00, 0x00, 0x00};
    83     83   	if (false) {
    84     84   	} else if (cp <= 0x7f) {
    85     85   		chu[0] = cp;
    86     86   	} else if (cp <= 0x07ff)  {
    87     87           chu[0]= (cp>>6)+192;

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

    16     16   #include "../using.hpp"
    17     17   #include <string>
    18     18   #if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC || CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_CLANG)
    19     19       #include <cxxabi.h>
    20     20   #endif
    21     21   
    22     22   namespace cxxomfort {
           23  +namespace library {
    23     24   namespace detail_demangle {
    24     25   
    25     26   // Thanks much to ′灵魂L.眼神 for making me notice this had to be made static!
    26     27   static std::string job (const char* name) {
    27     28   #if (CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_GCC || \
    28     29        CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_CLANG)
    29     30       char buf[1024];
................................................................................
    62     63       if (is_const<TnR>::value) { r+= " const"; }
    63     64       if (is_volatile<TnR>::value) { r+= " volatile"; }
    64     65       if (is_lvalue_reference<T>::value) { r+= "&"; }
    65     66       if (is_rvalue_reference<T>::value) { r+= "&&"; }
    66     67       return r;
    67     68   }
    68     69   
    69         -} //cxxomfort::
           70  +} // library
           71  +
           72  +// should this be deprecated in the future?
           73  +using library::type_name;
           74  +using library::typeid_demangle;
    70     75   
           76  +} // cxxomfort
    71     77   
    72     78   #endif

Changes to cxxomfort/cxxomfort/library/typesafe_enum.hpp.

     6      6    @see http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Type_Safe_Enum
     7      7    @see http://stackoverflow.com/questions/217549/which-typesafe-enum-in-c-are-you-using/11856721#11856721
     8      8   **/
     9      9   #include <cxxomfort/base.hpp>
    10     10   #include <type_traits>
    11     11   #include <cxxomfort/util/type_traits.hpp>
    12     12   #include <cxxomfort/impl/11-conditional.hpp>
           13  +#include <cxxomfort/using.hpp>
    13     14   
    14     15   /*
    15     16    * Usage is as follows:
    16     17    */
    17     18   #if 0 
    18     19   
    19     20   // example
    20         -struct myenum_def { enum type { member1, member2, member3 }; };
    21         -typedef typesafe_enum<myenum_def> myenum;
           21  +//struct myenum_def { enum type { member1, member2, member3 }; };
           22  +//typedef typesafe_enum<myenum_def> myenum;
    22     23   // quick and easy encapsulation
    23     24   
    24     25   #endif
    25     26   
    26     27   /* Section: declaration of safe_enum */
    27     28   
    28         -namespace cxxomfort {
           29  +namespace cxxomfort { namespace library {
    29     30   
    30     31   namespace detail_enum {
    31     32   struct safe_enum_tag {};
    32     33   } // detail_enum
    33     34   
    34     35   
    35     36   template<typename def, typename inner = typename def::type>
................................................................................
    38     39       public: 
    39     40       typedef typename def::type enum_type;
    40     41       typedef inner underlying_type;
    41     42    
    42     43       public:
    43     44       CXXO_CONSTEXPR typesafe_enum () CXXO_NOEXCEPT {}
    44     45       CXXO_CONSTEXPR typesafe_enum (typename def::type v) : val(v) {}
    45         -    CXXO_CONSTEXPR explicit typesafe_enum (underlying_type v) : val(v) {}
           46  +    template <typename Q>
           47  +    CXXO_CONSTEXPR explicit typesafe_enum (Q v
           48  +    , typename std::enable_if< false==std::is_same<Q,underlying_type>::value, Q>::type* = nullptr) 
           49  +    : val(v) {}
    46     50       CXXO_CONSTEXPR enum_type value() const CXXO_NOEXCEPT { return val; }
    47     51       CXXO_CONSTEXPR underlying_type underlying() const CXXO_NOEXCEPT { return val; }
    48     52       
    49     53       CXXO_EXPLICIT_OPERATOR(underlying_type) () const CXXO_NOEXCEPT { return val; }
    50     54   
    51     55       /*{
    52     56           enum { T_is_compatible_type = std::is_same<T, enum_type>::value };
................................................................................
   117    121   #else
   118    122   
   119    123   #endif // c++11
   120    124   */
   121    125   // end of idiom impl
   122    126   
   123    127   
   124         -
          128  +} // library
   125    129   } // cxxomfort::
   126    130   
   127    131   
   128    132   /* End section: safe_enum */
   129    133   
   130    134   /* Begin section: is_scoped_enum */
   131    135   
   132         -namespace cxxomfort {
          136  +namespace cxxomfort { namespace library {
   133    137   
   134    138   template <bool isenum, typename T>
   135    139   struct is_typesafeenum_helper;
   136    140   
   137    141   template <typename T> struct is_typesafeenum_helper<false,T> {
   138    142       // is_class == false
   139    143       enum { value= false };
................................................................................
   146    150   };
   147    151   
   148    152   template <typename T>
   149    153   struct is_typesafe_enum 
   150    154   : is_typesafeenum_helper <std::is_class<T>::value, T> {};
   151    155   
   152    156   template <typename T, typename S>
   153         -struct is_typesafe_enum< ::cxxomfort::typesafe_enum<T,S> > 
          157  +struct is_typesafe_enum< ::cxxomfort::library::typesafe_enum<T,S> > 
   154    158   // : is_scoped_enum_helper < false, ::cxxomfort::extras::safe_enum<T,S> > {};
   155    159   { enum { value = true}; };
   156    160   
   157    161   
   158    162   #if 0
   159    163   /* An enumerator is scoped if 
   160    164    * it is a native enum but it's not convertible 
................................................................................
   180    184   
   181    185   template <typename T>
   182    186   struct is_scoped_enum 
   183    187   : is_scoped_enum_helper< std::is_integral<T>::value, T > {};
   184    188   
   185    189   #endif
   186    190   
          191  +} // library
   187    192   } // cxxomfort::
   188    193   
   189    194   /* End section: safe_enum */
   190    195   
   191    196   #if 0    
   192    197   // let's try write a operator== that directly compares two different enums
   193    198   // This adds type safety by triggering an error when two 

Changes to cxxomfort/cxxomfort/string.hpp.

    12     12   
    13     13   
    14     14   #if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
    15     15   #pragma message CXXO_NOTICE("enabled <string> support.")
    16     16   #endif
    17     17   
    18     18   namespace cxxomfort {
    19         -/**
    20         - * @namespace
    21         - * @brief Namespace for <string>-related utilities in cxxomfort.
    22         - */
    23         -namespace string {
           19  +namespace cxxostd {
    24     20   }
    25     21   }
    26     22   
    27     23   #include "impl/11-to_string.hpp"
    28     24   //#include "impl/14-string_literal.hpp"
    29     25   
    30         -/**
    31         - * @{
    32         - */
    33         -
    34         -/**
    35         - * @}
    36         - */
    37         -
    38     26   #endif

Changes to cxxomfort/cxxomfort/type_traits.hpp.

   360    360   
   361    361   /*
   362    362    * make_void (c++17)
   363    363    */
   364    364   #include "impl/17-void_t.hpp"
   365    365   
   366    366   
          367  +/*
          368  + * bool_constant (c++17)
          369  + */
          370  +#include "impl/17-bool_constant.hpp"
          371  +
   367    372   /*
   368    373    * is_move_constructible for C++03, we seek for RV_REF constructors
   369    374    */
   370    375   
   371    376   #if (CXXOMFORT_CXX_STD < 2011) \
   372    377   || /* also missing in clang in C++11 mode */ \
   373    378   (CXXOMFORT_CXX_STD==2011 && CXXOMFORT_COMPILER_ID==CXXO_VALUE_COMPILER_CLANG && CXXOMFORT_COMPILER_VERSION<=304)  \

Changes to cxxomfort/cxxomfort/utility.hpp.

    28     28   
    29     29   #if (defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1))
    30     30   #pragma message CXXO_NOTICE("enabled <utility> support.")
    31     31   #endif
    32     32   
    33     33   
    34     34   namespace cxxomfort {
    35         -/**
    36         - * @namespace
    37         - * @brief Namespace for the <utility>-related backports and features in cxxomfort.
    38         - */
    39         -namespace utility {
           35  +namespace cxxostd {
    40     36       //! Unevaluated context.
    41     37       //! @ingroup utility
    42     38       //! @ingroup cxx11-backports
    43     39       template <typename T> typename cxxomfort::traits::add_reference<T>::type declval();
    44     40   }
    45     41   }
    46     42   
................................................................................
    53     49               #define CXXO_ADD_declval
    54     50           #endif
    55     51       #else
    56     52           #define CXXO_ADD_declval
    57     53       #endif
    58     54       #if defined(CXXO_ADD_declval)
    59     55   namespace std { 
    60         -    using ::cxxomfort::utility::declval;
           56  +    using ::cxxomfort::cxxostd::declval;
    61     57   } //std::
    62     58           #undef CXXO_ADD_declval
    63     59       #endif
    64     60   
    65     61   #endif
    66     62   #define CXXOMFORT_IMPLEMENTS_n1978 CXXO_BACKPORT()
    67     63   #define CXXOMFORT_IMPLEMENTS_n2343 CXXO_BACKPORT()

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

    32     32   CXXO_TYPEOF|type?|(expression)|
    33     33   make_array_ref|array_ref<T>|(T[N])|
    34     34   make_array_ref|array_ref<T>|(array / dynarray / valarray / vector)|
    35     35   seq_|"sequence type"|<T>(...sequence of T)|
    36     36   typeid_demangle|std::string|(typeid construct)|
    37     37   type_name|std::string|<T>() [parametrized on T]|
    38     38   #algorithm
           39  +count_frequencies_map|Iterator|(Iterator ini, Iterator fin, ValueMapIndex[]& v)|
    39     40   find_last_if|Iterator|(Iterator ini, Iterator fin, Predicate f)|
    40     41   transform_inplace|Iterator|(Iterator ini, Iterator fin, Function f)|
    41     42   transform_inplace_if|Iterator|(Iterator ini, Iterator fin, Function f, Predicate p)|
    42     43   transform_n|Iterator|(Iterator ini, Integer n, DestIterator out, Function f)|
    43     44   #functional
           45  +#numeric
           46  +#random
    44     47   #string
           48  +chr|std::string|(uint16_t ord)|
           49  +wchr|std::wstring|(uint32_t ord)|
           50  +utf8chr|std::string|(uint32_t ord)|
           51  +join|String|(String const& sep, Iterator1 ini, Iterator2 fin)|
           52  +split_to|Iterator|(String const& sep, String const& src, Iterator ini)|
    45     53   to_string|std::string|(expressions..., )|
    46     54   to_wstring|std::wstring|(expressions..., )|
    47     55   #tuple
    48         -tuple_shift|tuple<A_2,...,A_(n)>|(tuple<A_1,A_2,...,A_(n)>)|
    49         -tuple_pop|tuple<A_1,A_2,...,A_(n-1)>|(tuple<A_1,A_2,...,A_(n-1),A_(n)>)|
           56  +tuple_shift|tuple<A_{2...n}>|(tuple<A_{1...n}>)|
           57  +tuple_pop|tuple<A_{1...n-1}>|(tuple<A_{1...n}>)|
    50     58   #utility