drop dependency on boost.detail

This commit is contained in:
Andrzej Krzemienski
2024-01-03 21:41:26 +01:00
parent a1dbd3b67d
commit 01e80d2b87
10 changed files with 34 additions and 257 deletions

View File

@ -17,7 +17,6 @@ The implementation uses the following other Boost modules:
# assert
# config
# core
# detail
# move
# mpl
# static_assert
@ -34,15 +33,15 @@ Certain constructors and functions in the interface of `optional` perform a 'per
template<class... Args> optional(in_place_init_t, Args&&... args);
template<class... Args> optional(in_place_init_if_t, bool condition, Args&&... args);
template<class... Args> void emplace(Args&&... args);
On compilers that do not support variadic templates, each of these functions is substituted with two overloads, one forwarding a single argument, the other forwarding zero arguments. This forms the following set:
template<class Arg> optional(in_place_init_t, Arg&& arg);
optional(in_place_init_t);
template<class Arg> optional(in_place_init_if_t, bool condition, Arg&& arg);
optional(in_place_init_if_t, bool condition);
template<class Arg> void emplace(Arg&& arg);
void emplace();
@ -51,16 +50,16 @@ On compilers that do not support rvalue references, each of these functions is s
template<class Arg> optional(in_place_init_t, const Arg& arg);
template<class Arg> optional(in_place_init_t, Arg& arg);
optional(in_place_init_t);
template<class Arg> optional(in_place_init_if_t, bool condition, const Arg& arg);
template<class Arg> optional(in_place_init_if_t, bool condition, Arg& arg);
optional(in_place_init_if_t, bool condition);
template<class Arg> void emplace(const Arg& arg);
template<class Arg> void emplace(Arg& arg);
void emplace();
This workaround addresses about 40% of all use cases. If this is insufficient, you need to resort to using [link boost_optional.tutorial.in_place_factories In-Place Factories].
This workaround addresses about 40% of all use cases. If this is insufficient, you need to resort to using [link boost_optional.tutorial.in_place_factories In-Place Factories].
[endsect]
[section Optional Reference Binding][#optional_reference_binding]
@ -71,11 +70,11 @@ A number of compilers incorrectly treat const lvalues of integral type as rvalue
optional<const int&> or1;
optional<const int&> or2 = i; // caution: not portable
or1 = i; // caution: not portable
optional<const int&> or3(i); // portable
or1 = optional<const int&>(i); // portable
Compilers known to have these deficiencies include GCC versions 4.2, 4.3, 4.4, 4.5, 5.1, 5.2; QCC 4.4.2; MSVC versions 8.0, 9.0, 10.0, 11.0, 12.0. In order to check if your compiler correctly implements reference binding use this test program.
Compilers known to have these deficiencies include GCC versions 4.2, 4.3, 4.4, 4.5, 5.1, 5.2; QCC 4.4.2; MSVC versions 8.0, 9.0, 10.0, 11.0, 12.0. In order to check if your compiler correctly implements reference binding use this test program.
#include <cassert>
@ -88,13 +87,13 @@ Compilers known to have these deficiencies include GCC versions 4.2, 4.3, 4.4, 4
assert(&ii == &global_i);
}
void operator=(const int& ii)
void operator=(const int& ii)
{
assert(&ii == &global_i);
}
void operator=(int&&) // remove this if your compiler doesn't have rvalue refs
{
{
assert(false);
}
};
@ -110,7 +109,7 @@ Compilers known to have these deficiencies include GCC versions 4.2, 4.3, 4.4, 4
TestingReferenceBinding ttt2 = iref;
ttt2 = iref;
}
[endsect]
[endsect]
[endsect]