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

Overview
Comment:Commit 2019-08-22 - A forgotten error in <memory>.
  • config: Updated some changes to documentation.
  • memory: Fixed a wrong argument name in uninitialized_default_construct.
  • system_error: Fixed errc not default-constructing to zero in C++03 like enums do.
  • docgen: Improved documentation for library:tuple, library:typesafe_enum.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | y2019 | gcc_min_404 | clang_min_302 | docgen | openwatcom_min_200
Files: files | file ages | folders
SHA3-256:d5fcc075629289d798d4cae6d8bda9c89133422f379adbb61af73b40160d0ce1
User & Date: luismachuca 2019-08-22 19:09:01
Context
2019-08-26
04:23
Commit 2019-08-25 - Looking for a more independent solution.
  • cxxomfort: Warning: this commit breaks for Clang.
  • cxxomfort: Renamed CXXO_COMPILER_SUPPORT_cstd_... to CXXO_CXXSTDHEADER_... .
  • cxxomfort: Reworked some macros related to TR1 and its headers/namespaces to be more uniform.
  • cxxomfort: Taken the first steps in removing the need for a TR1 forwarder, with <array>.
  • array: Fixed detecting an <array> that is not there in MSVC 2005 (enhances: [11f57a70cf]).
  • array: Testing removal of requirement for a TR1 forwarder in the header.
  • cerrno: Added header, with definitions of some later POSIX error code macros for MSVC (enhances: [11f57a70cf]).
  • functional: Fixed visibility of (tr1::)hash when in GCC/Clang with TR1.
  • functional: Added baseline implementations for reference_wrapper, hash when before C++03.
  • random: Fixed detecting a <random> that is not there in MSVC 2005 (enhances: [11f57a70cf]).
  • random: Testing removal of requirement for a TR1 forwarder in the header.
  • type_traits: Testing ability to fake some intrinsics for is_enum, et al, in OpenWatcom (enhances: [b8ea55b791]).
  • system_error: Removed a warning of conversion to bool when in MSVC.
  • utility: Fixed make_integer_sequence et al, to use C++11 using... = where appropriate.
  • library:array_ref: Made def-ctor trivial in C++11 and do the "right thing" in <C++11.
check-in: deb47099 user: luismachuca tags: trunk, msvc_max_1700, pre-release, y2019, gcc_min_404, msvc_min_1599
2019-08-22
19:09
Commit 2019-08-22 - A forgotten error in <memory>.
  • config: Updated some changes to documentation.
  • memory: Fixed a wrong argument name in uninitialized_default_construct.
  • system_error: Fixed errc not default-constructing to zero in C++03 like enums do.
  • docgen: Improved documentation for library:tuple, library:typesafe_enum.
check-in: d5fcc075 user: luismachuca tags: trunk, y2019, gcc_min_404, clang_min_302, docgen, openwatcom_min_200
2019-08-17
04:29
Commit 2019-08-14 - Myriad memory and mangling maintenance minuscule fixes.
  • cxxomfort: output_info now takes a FILE* stream.
  • cxxomfort: Fixed month detection in CXXOMFORT_ISODATE().
  • cxxomfort: Fixed wrong usage of explicit_cast when in GCC "C++0x" mode.
  • cxxomfort: Fixed "do-nothing" move emulation in pre-C++03.
  • cxxomfort: Minimum improvements to move emulation in CXX_STD<1997 (enhances: [b8ea55b791]).
  • config: Added detection for _Pragma in some compilers.
  • config: Fixed missing nullptr_t (not nullptr) in Clang 2.8-3.2 for C++11 mode (enhances: [1cbdc0b48d]).
  • memory: Fixed namespace std for make_unique (C++14).
  • memory: Added default_delete to backports (previously internal) (C++11).
  • memory: Added fix:to_bool now also works with shared_ptr.
  • memory: Added fix:malloc_deleter component.
  • memory: destroy and uninitialized_default families moved to their own PR header.
  • random: Added fix:randmo for rand() bias (randmo()).
  • string_view: Made pointers in constructors const.
  • string_view: Added fix:make_string_view.
  • typeindex: Fixed inclusion of TR1 headers.
  • type_traits: Added missing reference to is_convertible from TR1.
  • library:type_name: Fixed [e59985dfdf] (stack buffer realloc with __cxa_demangle).
  • library:type_name: Changed implementation to typeid_demangle() so that user needs to include <typeinfo> explicitly.
check-in: 7df32629 user: luismachuca tags: trunk
Changes

Changes to cxxomfort/CHANGELOG.txt.

1
2







3
4
5
6
7
8
9
Commit 2019-08-14 - Myriad memory and mangling maintenance minuscule fixes.









  *  cxxomfort: <tt>output_info</tt> now takes a <tt>FILE*</tt> stream.
  *  cxxomfort: Fixed month detection in <tt>CXXOMFORT_ISODATE()</tt>.
  *  cxxomfort: Fixed wrong usage of <tt>explicit_cast</tt> when in GCC "C++0x" mode.
  *  cxxomfort: Fixed "do-nothing" move emulation in pre-C++03.
  *  cxxomfort: Minimum improvements to move emulation in CXX_STD<1997 (enhances: [b8ea55b791]).
  *  config: Added detection for <tt>_Pragma</tt> in some compilers.
|

>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Commit 2019-08-22 - A forgotten error in <memory>.

  *  config: Updated some changes to documentation.
  *  memory: Fixed a wrong argument name in <tt>uninitialized_default_construct</tt>.
  *  system_error: Fixed <tt>errc</tt>  not default-constructing to zero in C++03 like enums do.
  *  docgen: Improved documentation for library:tuple, library:typesafe_enum.


Commit 2019-08-14 - Myriad memory and mangling maintenance minuscule fixes.

  *  cxxomfort: <tt>output_info</tt> now takes a <tt>FILE*</tt> stream.
  *  cxxomfort: Fixed month detection in <tt>CXXOMFORT_ISODATE()</tt>.
  *  cxxomfort: Fixed wrong usage of <tt>explicit_cast</tt> when in GCC "C++0x" mode.
  *  cxxomfort: Fixed "do-nothing" move emulation in pre-C++03.
  *  cxxomfort: Minimum improvements to move emulation in CXX_STD<1997 (enhances: [b8ea55b791]).
  *  config: Added detection for <tt>_Pragma</tt> in some compilers.

Changes to cxxomfort/cxxomfort/config.hpp.

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
444
445
446
447
448
449
450



451

452
453
454
455
456
457
458
 * @ingroup cxxomfort-config
 *
 * This file contains configuration macros used by the cxxomfort library
 * and it is not intended to be directly used.
 */

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

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

................................................................................
    cxx_emulation = static_cast<unsigned>(CXXOMFORT_CXX_EMULATION) , 
    cplusplus = __cplusplus
    };
    
    /* struct */ 
}  ;




const struct info _ = {};


static inline 
void output_info (std::FILE * const ff= stdout) {
    using namespace std;
    fprintf( ff, "(cxxomfort:%u:%u ", _.date, _.version);
    fprintf( ff, "compiler:%u:%u:%lu ", _.compilerid, _.compilerversion, static_cast<unsigned long>(_.compilerversionfull) );
    fprintf( ff, "mode:%u:%u cpp:%lu)\n", _.cxx_std, _.cxx_emulation







|







 







>
>
>

>







6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
...
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
 * @ingroup cxxomfort-config
 *
 * This file contains configuration macros used by the cxxomfort library
 * and it is not intended to be directly used.
 */

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

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

................................................................................
    cxx_emulation = static_cast<unsigned>(CXXOMFORT_CXX_EMULATION) , 
    cplusplus = __cplusplus
    };
    
    /* struct */ 
}  ;

#if (CXXOMFORT_CXX_STD < 1997)
const struct info _;
#else
const struct info _ = {};
#endif

static inline 
void output_info (std::FILE * const ff= stdout) {
    using namespace std;
    fprintf( ff, "(cxxomfort:%u:%u ", _.date, _.version);
    fprintf( ff, "compiler:%u:%u:%lu ", _.compilerid, _.compilerversion, static_cast<unsigned long>(_.compilerversionfull) );
    fprintf( ff, "mode:%u:%u cpp:%lu)\n", _.cxx_std, _.cxx_emulation

Changes to cxxomfort/cxxomfort/config/clang.hpp.

8
9
10
11
12
13
14
15
16
17
18
19

20
21
22
23
24
25
26
 * Clang version history
 * https://en.wikipedia.org/wiki/LLVM
 * 
 * 6.0  	March 8, 2018
 * 4.0  	March 13, 2017
 * 3.8  	March 8, 2016
 * 3.6.2 	July 16, 2015 
 * 3.4.2 	June 19, 2014
 * 3.2 	December 20, 2012 **preferred**
 * 3.0 	December 1, 2011
 * 2.8 	October 5, 2010
 * 2.6 	October 23, 2009 

 * * 
 * 
Here follows a list of C++11 features for Clang:

TODO
 */








|


|

>







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Clang version history
 * https://en.wikipedia.org/wiki/LLVM
 * 
 * 6.0  	March 8, 2018
 * 4.0  	March 13, 2017
 * 3.8  	March 8, 2016
 * 3.6.2 	July 16, 2015 
 * 3.4.2 	June 19, 2014 **preferred, in Trusty dev**
 * 3.2 	December 20, 2012 **preferred**
 * 3.0 	December 1, 2011
 * 2.8 	October 5, 2010 
 * 2.6 	October 23, 2009 
 * 2.4  ????
 * * 
 * 
Here follows a list of C++11 features for Clang:

TODO
 */

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

4
5
6
7
8
9
10

11
12
13
14
15
16
17

18
19
20
21
22
23
24
25
26
27
#ifndef CXXOMFORT_CONFIG_GCC_HPP
#define CXXOMFORT_CONFIG_GCC_HPP

/*
 * GCC version history:
 * https://www.gnu.org/software/gcc/releases.html
 * 

 * 4.2 - 2007-07
 * 4.4 - 2009-04
 * 4.6 - 2011-06 **preferred**
 * 4.8 - 2013-03 **preferred**
 * 5.0 - 2015-04
 * 6.0 - 2016-04
 * 5.4 - 2016-06

 * 6.4 - 2017-07
 * 7.2 - 2017-08
 * 5.5 - 2017-10
 * 
 * 
Here follows a list of C++11 features for GCC:

 * static_assert - 403
 * decltype - 403
 * variadic templates - 404







>
|
|
<
|
|
|
|
>
|
|
<







4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20

21
22
23
24
25
26
27
#ifndef CXXOMFORT_CONFIG_GCC_HPP
#define CXXOMFORT_CONFIG_GCC_HPP

/*
 * GCC version history:
 * https://www.gnu.org/software/gcc/releases.html
 * 
 * 5.5 - 2017-10
 * 7.2 - 2017-08
 * 6.4 - 2017-07

 * 5.4 - 2016-06
 * 6.0 - 2016-04
 * 5.0 - 2015-04
 * 4.8 - 2013-03 **preferred, in Stretch / Trusty**
 * 4.6 - 2011-06 **preferred, in Jessie / Trusty**
 * 4.4 - 2009-04
 * 4.2 - 2007-07

 * 
 * 
Here follows a list of C++11 features for GCC:

 * static_assert - 403
 * decltype - 403
 * variadic templates - 404

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

4
5
6
7
8
9
10
11
12

13
14
15
16
17
18
19
20
21
22
23
#ifndef CXXOMFORT_CONFIG_MSC_HPP
#define CXXOMFORT_CONFIG_MSC_HPP

/*
 * 
 * MSVC version history
 * 
 * 8.0 (2005-11)
 * 9.0 / 2008 (2007-11)

 * 10.0 / 2010 (2010-04)
 * 11.0 / 2012 (2012-08)
 * 12.0 / 2013 (2013-10)
 * 14.0 / 2015 (2015-07). Generates telemetry!
 * 
 * 
 * In VC < 10, there is no such thing as C++11 emulation mode. What's more
 * important, in some versions the implementation of TR1 is broken or, in the
 * case of VC9 Express (2008) it won't install at all. 
 * Meaning that to be usable, this library needs to implement many
 * type_traits on its own.







|
|
>

<
|
|







4
5
6
7
8
9
10
11
12
13
14

15
16
17
18
19
20
21
22
23
#ifndef CXXOMFORT_CONFIG_MSC_HPP
#define CXXOMFORT_CONFIG_MSC_HPP

/*
 * 
 * MSVC version history
 * 
 * 14.0 / 2015 (2015-07). Generates telemetry!
 * 12.0 / 2013 (2013-10) **to be tested**
 * 11.0 / 2012 (2012-08) **preferred, Windows 7**
 * 10.0 / 2010 (2010-04)

 * 9.0 / 2008 (2007-11) **preferred**
 * 8.0 (2005-11)
 * 
 * 
 * In VC < 10, there is no such thing as C++11 emulation mode. What's more
 * important, in some versions the implementation of TR1 is broken or, in the
 * case of VC9 Express (2008) it won't install at all. 
 * Meaning that to be usable, this library needs to implement many
 * type_traits on its own.

Changes to cxxomfort/cxxomfort/impl/p0040-memory_management.hpp.

59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 * @sa @wg21{p0040r0} .
 * */
template <typename It>
void uninitialized_default_construct (It ini, It fin) {
    typedef typename std::iterator_traits<It>::value_type Value;
    It cur = ini;
    try {
        for (; cur != last; ++cur) {
            ::new (static_cast<void*>(std::addressof(*cur))) Value;
        }
    }  catch (...) {
        std::destroy(ini, cur);
        throw;
    }
}

/**
 * @brief Default-constructs objects in uninitialized memory.
 * @ingroup cxx17-backports
................................................................................
    typedef typename std::iterator_traits<It>::value_type Value;
    It cur = ini;
    try {
        for (; n > 0; (void) ++cur, --n) {
            ::new (static_cast<void*>(std::addressof(*cur))) Value;
        }
    }  catch (...) {
        std::destroy(ini, cur);
        throw;
    }
}

}
} // cxxomfort








|



|







 







|







59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
..
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
 * @sa @wg21{p0040r0} .
 * */
template <typename It>
void uninitialized_default_construct (It ini, It fin) {
    typedef typename std::iterator_traits<It>::value_type Value;
    It cur = ini;
    try {
        for (; cur != fin; ++cur) {
            ::new (static_cast<void*>(std::addressof(*cur))) Value;
        }
    }  catch (...) {
        destroy(ini, cur);
        throw;
    }
}

/**
 * @brief Default-constructs objects in uninitialized memory.
 * @ingroup cxx17-backports
................................................................................
    typedef typename std::iterator_traits<It>::value_type Value;
    It cur = ini;
    try {
        for (; n > 0; (void) ++cur, --n) {
            ::new (static_cast<void*>(std::addressof(*cur))) Value;
        }
    }  catch (...) {
        destroy(ini, cur);
        throw;
    }
}

}
} // cxxomfort

Changes to cxxomfort/cxxomfort/memory.hpp.

33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
..
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
...
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#include <cxxomfort/type_traits.hpp> // is_convertible

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

// 
// aligned_storage
//

#if (CXXOMFORT_CXX_STD>=2011)

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


//
// aligned_union
//


// 
// default_delete
// 

#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,>=1600)) // MSVC 2010 already has it
#elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC && CXXOMFORT_CXX_EMULATION>=2011)
#else

namespace std {
	template <typename T> struct default_delete {

		default_delete () throw() {}

		template <class U>
		default_delete ( default_delete<U> const&
		, typename std::enable_if<std::is_convertible<U*, T*>::value, void>::type* = 0 )  
		{ }

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

	};
	
	template <typename T> struct default_delete<T[]> {

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

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

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


// 
// pointer_traits , allocator_traits
// 

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

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_MEMTOOLS
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
................................................................................
#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXOMFORT_CXX_STD>=1997)
	#include "impl/unique_ptr.hpp"
#else
	#include "impl/unique_ptr-poor.hpp"
#endif

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


................................................................................
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC)
        #define alignas(N) __declspec(align(N))
    #endif
*/
#endif


// 
// destroy, uninitialized_default_construct, ...
// 

#include "impl/p0040-memory_management.hpp"


// 
// cxxomfort::fix assist: to_bool
// 

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

#else

#endif // memtools


// 
// assist: malloc_deleter extension
// 
namespace cxxomfort { namespace fix {

struct malloc_deleter {
	void operator() (void* ptr) { free(ptr); }
};

} } // cxxomfort::fix::


// -- set up needed things in std::
#if (CXXOMFORT_CXX_STD < 2011 && defined(CXXOMFORT_USING_unique_ptr))
................................................................................


#endif // file

/**
 * @page std0memory <memory>
 * @brief Backports from <memory>
 * 
 * Interfaces defined here:
 *
 * * @c alignof() (C++11) (See @e base_features ).
 * * @c addressof() (C++11) - get the memory address of an object.
 * * Pointer traits and Allocator traits (C++11) - tools for assisting in the design of containers.
 * * @link cxxomfort::cxxostd::aligned_storage @c aligned_storage @endlink </code> (C++11) - create an unitialized buffer for storing an object of a given type.
 * * @link cxxomfort::cxxostd::unique_ptr @c unique_ptr @endlink (C++11) - smart pointer that owns and holds a resource.
 * * @c make_unique() (C++14) - assist for creating @c unique_ptr .
 * 
 * Non-backport interfaces:
 * 
 * * <tt>to_bool(<std::unique_ptr> const&)</tt> - briefer validity check to @c bool .
 * * <tt>to_bool(<std::shared_ptr> const&)</tt> - briefer validity check to @c bool .
 * * <tt>malloc_deleter</tt>.
 *
 * @section also See Also
 * 
 * * @see @cppref{header/memory} 
 *
 * */







|







 







|

|













|








|







 







|

|







 







|
|
|







 







|

|




|

|







 







|

|



|







 







|








|

|





|
|


33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
..
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
..
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
...
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
...
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
...
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
#include <cxxomfort/type_traits.hpp> // is_convertible

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

//
// aligned_storage
//

#if (CXXOMFORT_CXX_STD>=2011)

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


//
// aligned_union
//


//
// default_delete
//

#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXO_COMPILERVERSION_COMPARE(CXXO_COMPILERID_MSC,>=1600)) // MSVC 2010 already has it
#elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_GCC && CXXOMFORT_CXX_EMULATION>=2011)
#else

namespace std {
	template <typename T> struct default_delete {

		default_delete () throw() {}

		template <class U>
		default_delete ( default_delete<U> const&
		, typename std::enable_if<std::is_convertible<U*, T*>::value, void>::type* = 0 )
		{ }

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

	};

	template <typename T> struct default_delete<T[]> {

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

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

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


//
// pointer_traits , allocator_traits
//

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

#if (CXXOMFORT_CXX_STD < 2011)
    #define CXXOMFORT_USING_MEMTOOLS
    #if defined(CXXOMFORT_NOTICES) && (CXXOMFORT_NOTICES > 1)
................................................................................
#if (CXXOMFORT_CXX_STD>=2011)
#elif (CXXOMFORT_CXX_STD>=1997)
	#include "impl/unique_ptr.hpp"
#else
	#include "impl/unique_ptr-poor.hpp"
#endif

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


................................................................................
    #elif (CXXOMFORT_COMPILER_ID==CXXO_COMPILERID_MSC)
        #define alignas(N) __declspec(align(N))
    #endif
*/
#endif


//
// destroy, uninitialized_default_construct, ...
//

#include "impl/p0040-memory_management.hpp"


//
// cxxomfort::fix assist: to_bool
//

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

#else

#endif // memtools


//
// assist: malloc_deleter extension
//
namespace cxxomfort { namespace fix {

struct malloc_deleter {
	void operator() (void* ptr) { std::free(ptr); }
};

} } // cxxomfort::fix::


// -- set up needed things in std::
#if (CXXOMFORT_CXX_STD < 2011 && defined(CXXOMFORT_USING_unique_ptr))
................................................................................


#endif // file

/**
 * @page std0memory <memory>
 * @brief Backports from <memory>
 *
 * Interfaces defined here:
 *
 * * @c alignof() (C++11) (See @e base_features ).
 * * @c addressof() (C++11) - get the memory address of an object.
 * * Pointer traits and Allocator traits (C++11) - tools for assisting in the design of containers.
 * * @link cxxomfort::cxxostd::aligned_storage @c aligned_storage @endlink </code> (C++11) - create an unitialized buffer for storing an object of a given type.
 * * @link cxxomfort::cxxostd::unique_ptr @c unique_ptr @endlink (C++11) - smart pointer that owns and holds a resource.
 * * @c make_unique() (C++14) - assist for creating @c unique_ptr .
 *
 * Non-backport interfaces:
 *
 * * <tt>to_bool(<std::unique_ptr> const&)</tt> - briefer validity check to @c bool .
 * * <tt>to_bool(<std::shared_ptr> const&)</tt> - briefer validity check to @c bool .
 * * <tt>malloc_deleter</tt>.
 *
 * @section also See Also
 *
 * * @see @cppref{header/memory}
 *
 * */