2
0
mirror of https://github.com/boostorg/variant.git synced 2026-01-19 04:42:16 +00:00

Remove obsolete code (#109)

This commit is contained in:
Antony Polukhin
2024-01-08 20:13:32 +03:00
committed by GitHub
parent e37df948d7
commit b33ff4f811
11 changed files with 12 additions and 276 deletions

View File

@@ -104,11 +104,6 @@
<listitem><code>Sequence</code> must meet the requirements of
<libraryname>MPL</libraryname>'s <emphasis>Sequence</emphasis>
concept.</listitem>
<listitem>Due to standard conformance problems in several compilers,
<code>make_recursive_variant_over</code> may not be supported on
your compiler. See
<code><macroname>BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT</macroname></code>
for more information.</listitem>
</itemizedlist>
</description>
</class>

View File

@@ -951,11 +951,6 @@
<listitem><code>Sequence</code> must meet the requirements of
<libraryname>MPL</libraryname>'s <emphasis>Sequence</emphasis>
concept.</listitem>
<listitem>Due to standard conformance problems in several compilers,
<code>make_variant_over</code> may not be supported on your
compiler. See
<code><macroname>BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT</macroname></code>
for more information.</listitem>
</itemizedlist>
</description>
</class>

View File

@@ -91,21 +91,6 @@
</description>
</macro>
<macro name="BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT">
<purpose>
<simpara>Indicates absence of support for specifying the bounded types
of a <code><classname>variant</classname></code> by the elements of a
type sequence.</simpara>
</purpose>
<description>
<para>Defined only if
<code><classname>make_variant_over</classname></code> and
<code><classname>make_recursive_variant_over</classname></code>
are not supported for some reason on the target compiler.</para>
</description>
</macro>
<macro name="BOOST_VARIANT_DO_NOT_SPECIALIZE_STD_HASH">
<purpose>
<simpara>Define this macro if you do not wish to have a <code><classname>std::hash</classname></code> specialization for

View File

@@ -90,13 +90,6 @@ typedef <classname>mpl::push_front</classname>&lt; types_initial, int &gt;::type
</para>
<para><emphasis role="bold">Portability</emphasis>: Unfortunately, due to
standard conformance issues in several compilers,
<code>make_variant_over</code> is not universally available. On these
compilers the library indicates its lack of support for the syntax via the
definition of the preprocessor symbol
<code><macroname>BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT</macroname></code>.</para>
</section>
<section id="variant.tutorial.recursive">

View File

@@ -22,7 +22,6 @@
#include <boost/variant/recursive_wrapper_fwd.hpp>
#include <boost/variant/detail/move.hpp>
#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
# include <boost/mpl/aux_/value_wknd.hpp>
# include <boost/mpl/int.hpp>
# include <boost/mpl/iter_fold.hpp>
@@ -30,12 +29,7 @@
# include <boost/mpl/deref.hpp>
# include <boost/mpl/pair.hpp>
# include <boost/mpl/protect.hpp>
#else
# include <boost/variant/variant_fwd.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/enum.hpp>
# include <boost/preprocessor/repeat.hpp>
#endif
namespace boost {
namespace detail { namespace variant {
@@ -53,8 +47,6 @@ namespace detail { namespace variant {
// size of the variant's psuedo-variadic template parameter list.
//
#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
// (detail) quoted metafunction make_initializer_node
//
// Exposes a pair whose first type is a node in the initializer hierarchy.
@@ -81,7 +73,6 @@ struct make_initializer_node
typedef typename unwrap_recursive<recursive_enabled_T>::type
public_T;
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
typedef boost::is_reference<public_T>
is_reference_content_t;
@@ -92,10 +83,6 @@ struct make_initializer_node
typedef typename boost::mpl::if_<is_reference_content_t, disable_overload<public_T>, public_T&& >::type
param2_T;
#else
typedef typename call_traits<public_T>::param_type
param_T;
#endif
public: // static functions
@@ -111,7 +98,6 @@ struct make_initializer_node
return BOOST_MPL_AUX_VALUE_WKND(index)::value; // which
}
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
static int initialize(void* dest, param2_T operand)
{
// This assert must newer trigger, because all the reference contents are
@@ -122,7 +108,6 @@ struct make_initializer_node
new(dest) value_T( boost::detail::variant::move(operand) );
return BOOST_MPL_AUX_VALUE_WKND(index)::value; // which
}
#endif
};
friend class initializer_node;
@@ -150,61 +135,6 @@ public: // static functions
};
#else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
// Obsolete. Remove.
#define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_PARAMS \
BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) \
/**/
// Obsolete. Remove.
#define BOOST_VARIANT_AUX_PP_INITIALIZER_DEFINE_PARAM_T(N) \
typedef typename unwrap_recursive< \
BOOST_PP_CAT(recursive_enabled_T,N) \
>::type BOOST_PP_CAT(public_T,N); \
typedef typename call_traits< \
BOOST_PP_CAT(public_T,N) \
>::param_type BOOST_PP_CAT(param_T,N); \
/**/
template < BOOST_VARIANT_ENUM_PARAMS(typename recursive_enabled_T) >
struct preprocessor_list_initializer
{
public: // static functions
#define BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION(z,N,_) \
typedef typename unwrap_recursive< \
BOOST_PP_CAT(recursive_enabled_T,N) \
>::type BOOST_PP_CAT(public_T,N); \
typedef typename call_traits< \
BOOST_PP_CAT(public_T,N) \
>::param_type BOOST_PP_CAT(param_T,N); \
static int initialize( \
void* dest \
, BOOST_PP_CAT(param_T,N) operand \
) \
{ \
typedef typename boost::detail::make_reference_content< \
BOOST_PP_CAT(recursive_enabled_T,N) \
>::type internal_T; \
\
new(dest) internal_T(operand); \
return (N); /*which*/ \
} \
/**/
BOOST_PP_REPEAT(
BOOST_VARIANT_LIMIT_TYPES
, BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION
, _
)
#undef BOOST_VARIANT_AUX_PP_INITIALIZE_FUNCTION
};
#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
}} // namespace detail::variant
} // namespace boost
@@ -216,8 +146,6 @@ public: // static functions
// most appropriate to the current compiler.
//
#if !defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
#define BOOST_VARIANT_AUX_INITIALIZER_T( mpl_seq, typename_base ) \
::boost::mpl::iter_fold< \
mpl_seq \
@@ -231,19 +159,4 @@ public: // static functions
>::type::first \
/**/
#else // defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
// Obsolete. Remove.
#define BOOST_VARIANT_AUX_PP_INITIALIZER_TEMPLATE_ARGS(typename_base) \
BOOST_VARIANT_ENUM_PARAMS(typename_base) \
/**/
#define BOOST_VARIANT_AUX_INITIALIZER_T( mpl_seq, typename_base ) \
::boost::detail::variant::preprocessor_list_initializer< \
BOOST_VARIANT_ENUM_PARAMS(typename_base) \
> \
/**/
#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
#endif // BOOST_VARIANT_DETAIL_INITIALIZER_HPP

View File

@@ -22,10 +22,7 @@
#include <boost/mpl/aux_/preprocessor/repeat.hpp>
#include <boost/mpl/int_fwd.hpp>
#include <boost/mpl/limits/arity.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/arithmetic/inc.hpp>
#include <boost/preprocessor/iterate.hpp>
namespace boost {
namespace detail { namespace variant {

View File

@@ -16,8 +16,6 @@
#include <iosfwd> // for std::basic_ostream forward declare
#include <boost/variant/variant_fwd.hpp>
#include <boost/detail/templated_streams.hpp>
#include <boost/variant/static_visitor.hpp>
namespace boost {
@@ -29,14 +27,9 @@ namespace boost {
//
// forward declare (allows output of embedded variant< variant< ... >, ... >)
template <
BOOST_TEMPLATED_STREAM_ARGS(E,T)
BOOST_TEMPLATED_STREAM_COMMA
BOOST_VARIANT_ENUM_PARAMS(typename U)
>
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
, const variant< BOOST_VARIANT_ENUM_PARAMS(U) >& rhs
template <class CharT, class Trait, typename... U>
inline std::basic_ostream<CharT, Trait>& operator<<(
std::basic_ostream<CharT, Trait>& out, const variant<U...>& rhs
);
namespace detail { namespace variant {
@@ -71,18 +64,13 @@ private:
}} // namespace detail::variant
template <
BOOST_TEMPLATED_STREAM_ARGS(E,T)
BOOST_TEMPLATED_STREAM_COMMA
BOOST_VARIANT_ENUM_PARAMS(typename U)
>
inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<(
BOOST_TEMPLATED_STREAM(ostream, E,T)& out
, const variant< BOOST_VARIANT_ENUM_PARAMS(U) >& rhs
template <class CharT, class Trait, typename... U>
inline std::basic_ostream<CharT, Trait>& operator<<(
std::basic_ostream<CharT, Trait>& out, const variant<U...>& rhs
)
{
detail::variant::printer<
BOOST_TEMPLATED_STREAM(ostream, E,T)
std::basic_ostream<CharT, Trait>
> visitor(out);
rhs.apply_visitor(visitor);

View File

@@ -53,13 +53,6 @@
#endif
// Define a compiler generic null pointer value
#if defined(BOOST_NO_CXX11_NULLPTR)
#define BOOST_VARIANT_NULL 0
#else
#define BOOST_VARIANT_NULL nullptr
#endif
namespace boost {
namespace detail { namespace variant {
@@ -179,7 +172,7 @@ inline typename Visitor::result_type
visitation_impl(
int, int, Visitor&, VPCV
, mpl::true_ // is_apply_visitor_unrolled
, NBF, W* = BOOST_VARIANT_NULL, S* = BOOST_VARIANT_NULL
, NBF, W* = nullptr, S* = nullptr
)
{
// should never be here at runtime!
@@ -198,7 +191,7 @@ visitation_impl(
, Visitor& visitor, VoidPtrCV storage
, mpl::false_ // is_apply_visitor_unrolled
, NoBackupFlag no_backup_flag
, Which* = BOOST_VARIANT_NULL, step0* = BOOST_VARIANT_NULL
, Which* = nullptr, step0* = nullptr
)
{
// Typedef apply_visitor_unrolled steps and associated types...

View File

@@ -40,8 +40,6 @@
#include <boost/blank.hpp>
#include <boost/integer/common_factor_ct.hpp>
#include <boost/static_assert.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/type_traits/aligned_storage.hpp>
#include <boost/type_traits/alignment_of.hpp>
#include <boost/type_traits/add_const.hpp>
@@ -1096,8 +1094,6 @@ private: // helpers, for typedefs (below)
{
};
#if !defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
private: // helpers, for typedefs (below)
typedef typename mpl::eval_if<
@@ -1141,82 +1137,6 @@ private: // internal typedefs
internal_types
>::type internal_T0;
#else // defined(BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT)
private: // helpers, for typedefs (below)
typedef unwrapped_T0_ T0;
#define BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS(z,N,_) \
typedef typename mpl::eval_if< \
is_recursive_ \
, detail::variant::enable_recursive< \
BOOST_PP_CAT(T,N) \
, wknd_self_t \
> \
, mpl::identity< BOOST_PP_CAT(T,N) > \
>::type BOOST_PP_CAT(recursive_enabled_T,N); \
/**/
BOOST_PP_REPEAT(
BOOST_VARIANT_LIMIT_TYPES
, BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS
, _
)
#undef BOOST_VARIANT_AUX_ENABLE_RECURSIVE_TYPEDEFS
#define BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS(z,N,_) \
typedef typename unwrap_recursive< \
BOOST_PP_CAT(recursive_enabled_T,N) \
>::type BOOST_PP_CAT(public_T,N); \
/**/
BOOST_PP_REPEAT(
BOOST_VARIANT_LIMIT_TYPES
, BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS
, _
)
#undef BOOST_VARIANT_AUX_UNWRAP_RECURSIVE_TYPEDEFS
public: // public typedefs
typedef typename detail::variant::make_variant_list<
BOOST_VARIANT_ENUM_PARAMS(public_T)
>::type types;
private: // helpers, for internal typedefs (below)
#define BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS(z,N,_) \
typedef detail::make_reference_content< \
BOOST_PP_CAT(recursive_enabled_T,N) \
>::type BOOST_PP_CAT(internal_T,N); \
/**/
BOOST_PP_REPEAT(
BOOST_VARIANT_LIMIT_TYPES
, BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS
, _
)
#undef BOOST_VARIANT_AUX_MAKE_REFERENCE_CONTENT_TYPEDEFS
private: // internal typedefs
typedef typename detail::variant::make_variant_list<
BOOST_VARIANT_ENUM_PARAMS(internal_T)
>::type internal_types;
private: // static precondition assertions
// NOTE TO USER :
// variant< type-sequence > syntax is not supported on this compiler!
//
BOOST_MPL_ASSERT_NOT(( is_sequence_based_ ));
#endif // BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT workaround
private: // helpers, for representation (below)
typedef typename detail::variant::find_fallback_type<

View File

@@ -25,15 +25,6 @@
#include <boost/preprocessor/enum_shifted_params.hpp>
#include <boost/preprocessor/repeat.hpp>
///////////////////////////////////////////////////////////////////////////////
// macro BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
//
// Defined if variant does not support make_variant_over (see below).
//
#if defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
# define BOOST_VARIANT_NO_TYPE_SEQUENCE_SUPPORT
#endif
///////////////////////////////////////////////////////////////////////////////
// macro BOOST_VARIANT_NO_FULL_RECURSIVE_VARIANT_SUPPORT
//
@@ -118,40 +109,6 @@ struct convert_void< void_ >
typedef mpl::na type;
};
///////////////////////////////////////////////////////////////////////////////
// (workaround) BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
//
// Needed to work around compilers that don't support using-declaration
// overloads. (See the variant::initializer workarounds below.)
//
#if defined(BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE)
// (detail) tags voidNN -- NN defined on [0, BOOST_VARIANT_LIMIT_TYPES)
//
// Defines void types that are each unique and specializations of
// convert_void that yields mpl::na for each voidNN type.
//
#define BOOST_VARIANT_DETAIL_DEFINE_VOID_N(z,N,_) \
struct BOOST_PP_CAT(void,N); \
\
template <> \
struct convert_void< BOOST_PP_CAT(void,N) > \
{ \
typedef mpl::na type; \
}; \
/**/
BOOST_PP_REPEAT(
BOOST_VARIANT_LIMIT_TYPES
, BOOST_VARIANT_DETAIL_DEFINE_VOID_N
, _
)
#undef BOOST_VARIANT_DETAIL_DEFINE_VOID_N
#endif // BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE workaround
}} // namespace detail::variant
#define BOOST_VARIANT_AUX_DECLARE_PARAMS BOOST_VARIANT_ENUM_PARAMS(typename T)

View File

@@ -79,7 +79,7 @@ struct rvalue_ref_decltype_visitor
#endif
template <typename Checker, typename Variant>
inline void unary_test(Variant& var, Checker* = BOOST_VARIANT_NULL)
inline void unary_test(Variant& var, Checker* = nullptr)
{
Checker checker;
const Checker& const_checker = checker;
@@ -97,7 +97,7 @@ inline void unary_test(Variant& var, Checker* = BOOST_VARIANT_NULL)
}
template <typename Checker, typename Variant1, typename Variant2>
inline void binary_test(Variant1& var1, Variant2& var2, Checker* = BOOST_VARIANT_NULL)
inline void binary_test(Variant1& var1, Variant2& var2, Checker* = nullptr)
{
Checker checker;
const Checker& const_checker = checker;