set stub implementation

[SVN r18340]
This commit is contained in:
Aleksey Gurtovoy
2003-05-03 02:07:24 +00:00
parent d1a4ff6bc5
commit c852ca8d41
11 changed files with 302 additions and 12 deletions

View File

@@ -0,0 +1,38 @@
#ifndef BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED
#define BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED
// + file: boost/mpl/aux_/has_key_impl.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/has_key_fwd.hpp"
#include "boost/mpl/aux_/traits_lambda_spec.hpp"
namespace boost {
namespace mpl {
// no default implementation; the definition is needed to make MSVC happy
template< typename Tag > struct has_key_impl
{
template< typename AssociativeSequence, typename Key > struct apply;
};
BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(2,has_key_impl)
}}
#endif // BOOST_MPL_AUX_HAS_KEY_IMPL_HPP_INCLUDED

View File

@@ -21,7 +21,7 @@
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__GNUC__, < 3) || BOOST_WORKAROUND(__GNUC__, < 3)
# define BOOST_MPL_AUX_ICE_CAST(T, expr) T(expr) # define BOOST_MPL_AUX_ICE_CAST(T, expr) (T)(expr)
#elif BOOST_WORKAROUND(__MWERKS__, <= 0x3001) #elif BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
# define BOOST_MPL_AUX_ICE_CAST(T, expr) (T)(expr) # define BOOST_MPL_AUX_ICE_CAST(T, expr) (T)(expr)
#else #else

View File

@@ -17,7 +17,7 @@
// no include guards, the header is intended for multiple inclusion! // no include guards, the header is intended for multiple inclusion!
#include "boost/mpl/aux_/ice_cast.hpp" #include "boost/mpl/aux_/static_cast.hpp"
#include "boost/mpl/aux_/config/nttp.hpp" #include "boost/mpl/aux_/config/nttp.hpp"
#include "boost/mpl/aux_/config/static_constant.hpp" #include "boost/mpl/aux_/config/static_constant.hpp"
#include "boost/mpl/aux_/config/workaround.hpp" #include "boost/mpl/aux_/config/workaround.hpp"
@@ -60,19 +60,19 @@ struct AUX_WRAPPER_NAME
// either // either
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) #if BOOST_WORKAROUND(__EDG_VERSION__, <= 243)
private: private:
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)));
BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1))); BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, prior_value = BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)));
public: public:
typedef AUX_WRAPPER_INST(next_value) next; typedef AUX_WRAPPER_INST(next_value) next;
typedef AUX_WRAPPER_INST(prior_value) prior; typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \ #elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \ || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800)) || BOOST_WORKAROUND(__HP_aCC, BOOST_TESTED_AT(53800))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next; typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior; typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else #else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next; typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior; typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
#endif #endif
// enables uniform function call syntax for families of overloaded // enables uniform function call syntax for families of overloaded

View File

@@ -0,0 +1,31 @@
#ifndef BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
#define BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED
// + file: boost/mpl/aux_/static_cast.hpp
// + last modified: 02/may/03
// Copyright (c) 2001-03
// Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/aux_/config/workaround.hpp"
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__GNUC__, < 3) \
|| BOOST_WORKAROUND(__MWERKS__, <= 0x3001)
# define BOOST_MPL_AUX_STATIC_CAST(T, expr) (T)(expr)
#else
# define BOOST_MPL_AUX_STATIC_CAST(T, expr) static_cast<T>(expr)
#endif
#endif // BOOST_MPL_AUX_STATIC_CAST_HPP_INCLUDED

View File

@@ -0,0 +1,45 @@
#ifndef BOOST_MPL_HAS_KEY_HPP_INCLUDED
#define BOOST_MPL_HAS_KEY_HPP_INCLUDED
// + file: boost/mpl/has_key.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/has_key_fwd.hpp"
#include "boost/mpl/aux_/has_key_impl.hpp"
#include "boost/mpl/aux_/sequence_tag.hpp"
#include "boost/mpl/aux_/void_spec.hpp"
#include "boost/mpl/aux_/lambda_support.hpp"
namespace boost {
namespace mpl {
template<
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(AssociativeSequence)
, typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Key)
>
struct has_key
: has_key_impl< typename BOOST_MPL_AUX_SEQUENCE_TAG(AssociativeSequence) >
::template apply<AssociativeSequence,Key>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,has_key,(AssociativeSequence,Key))
};
BOOST_MPL_AUX_VOID_SPEC(2, has_key)
}}
#endif // BOOST_MPL_HAS_KEY_HPP_INCLUDED

View File

@@ -0,0 +1,29 @@
#ifndef BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
#define BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
// + file: boost/mpl/has_key_fwd.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
namespace boost {
namespace mpl {
template< typename Tag > struct has_key_impl;
template< typename AssociativeSequence, typename Key > struct has_key;
}}
#endif // BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED

View File

@@ -18,7 +18,7 @@
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/aux_/value_wknd.hpp" #include "boost/mpl/aux_/value_wknd.hpp"
#include "boost/mpl/aux_/ice_cast.hpp" #include "boost/mpl/aux_/static_cast.hpp"
#include "boost/mpl/aux_/void_spec.hpp" #include "boost/mpl/aux_/void_spec.hpp"
#include "boost/mpl/aux_/lambda_support.hpp" #include "boost/mpl/aux_/lambda_support.hpp"
#include "boost/mpl/aux_/config/workaround.hpp" #include "boost/mpl/aux_/config/workaround.hpp"
@@ -65,7 +65,7 @@ struct if_
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561))
BOOST_MPL_AUX_VALUE_WKND(C)::value BOOST_MPL_AUX_VALUE_WKND(C)::value
#else #else
BOOST_MPL_AUX_ICE_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(C)::value) BOOST_MPL_AUX_STATIC_CAST(bool, BOOST_MPL_AUX_VALUE_WKND(C)::value)
#endif #endif
, T1 , T1
, T2 , T2
@@ -205,7 +205,7 @@ struct if_
enum { c_ = C_::value }; enum { c_ = C_::value };
public: public:
typedef typename answer< BOOST_MPL_AUX_ICE_CAST(bool, c_) >::type type; typedef typename answer< BOOST_MPL_AUX_STATIC_CAST(bool, c_) >::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2)) BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C_,T1,T2))
}; };
@@ -256,7 +256,7 @@ template<
> >
struct if_ struct if_
{ {
typedef typename aux::if_impl< BOOST_MPL_AUX_ICE_CAST(bool, C::value) > typedef typename aux::if_impl< BOOST_MPL_AUX_STATIC_CAST(bool, C::value) >
::template result_<T1,T2>::type type; ::template result_<T1,T2>::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2)) BOOST_MPL_AUX_LAMBDA_SUPPORT(3,if_,(C,T1,T2))

View File

@@ -0,0 +1,49 @@
#ifndef BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED
// + file: boost/mpl/aux_/has_key_impl.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/set/aux_/tag.hpp"
#include "boost/mpl/has_key_fwd.hpp"
#include "boost/mpl/bool.hpp"
#include "boost/mpl/aux_/static_cast.hpp"
#include "boost/mpl/aux_/yes_no.hpp"
#include "boost/mpl/aux_/type_wrapper.hpp"
namespace boost {
namespace mpl {
aux::no_tag has_key_test(...);
template<>
struct has_key_impl< aux::set_tag >
{
template< typename Set, typename T > struct apply
: bool_<
( sizeof( has_key_test(
BOOST_MPL_AUX_STATIC_CAST(Set*, 0)
, BOOST_MPL_AUX_STATIC_CAST(aux::type_wrapper<T>*, 0)
) ) == sizeof(aux::yes_tag) )
>
{
};
};
}}
#endif // BOOST_MPL_SET_AUX_HAS_KEY_IMPL_HPP_INCLUDED

View File

@@ -0,0 +1,34 @@
#ifndef BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED
// + file: boost/mpl/aux_/set0.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
#include "boost/mpl/void.hpp"
#include "boost/mpl/set/aux_/tag.hpp"
namespace boost {
namespace mpl {
template< typename D_ = void_ > struct set0
{
typedef aux::set_tag tag;
};
}}
#endif // BOOST_MPL_SET_AUX_SET0_HPP_INCLUDED

View File

@@ -0,0 +1,27 @@
#ifndef BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED
// + file: boost/mpl/aux_/tag.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
namespace boost { namespace mpl { namespace aux {
struct set_tag;
}}}
#endif // BOOST_MPL_SET_AUX_TAG_HPP_INCLUDED

View File

@@ -0,0 +1,37 @@
#ifndef BOOST_MPL_SET_SET0_HPP_INCLUDED
#define BOOST_MPL_SET_SET0_HPP_INCLUDED
// + file: boost/mpl/set0.hpp
// + last modified: 02/may/03
// Copyright (c) 2002-03
// David Abrahams, Aleksey Gurtovoy
//
// Permission to use, copy, modify, distribute and sell this software
// and its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appears in all copies and
// that both the copyright notice and this permission notice appear in
// supporting documentation. No representations are made about the
// suitability of this software for any purpose. It is provided "as is"
// without express or implied warranty.
//
// See http://www.boost.org/libs/mpl for documentation.
//#include "boost/mpl/set/aux_/at.hpp"
//#include "boost/mpl/set/aux_/front.hpp"
//#include "boost/mpl/set/aux_/push_front.hpp"
//#include "boost/mpl/set/aux_/pop_front.hpp"
//#include "boost/mpl/set/aux_/back.hpp"
//#include "boost/mpl/set/aux_/clear.hpp"
//#include "boost/mpl/set/aux_/O1_size.hpp"
//#include "boost/mpl/set/aux_/size.hpp"
//#include "boost/mpl/set/aux_/empty.hpp"
//#include "boost/mpl/set/aux_/item.hpp"
//#include "boost/mpl/set/aux_/iterator.hpp"
#include "boost/mpl/set/aux_/has_key_impl.hpp"
#include "boost/mpl/set/aux_/set0.hpp"
//#include "boost/mpl/set/aux_/begin_end.hpp"
//#include "boost/mpl/set/aux_/tag.hpp"
#endif // BOOST_MPL_SET_SET0_HPP_INCLUDED