Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70633 - in sandbox/opaque/boost/opaque: . meta_mixin
From: vicente.botet_at_[hidden]
Date: 2011-03-27 10:12:23


Author: viboes
Date: 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
New Revision: 70633
URL: http://svn.boost.org/trac/boost/changeset/70633

Log:
Opaque: file cleanup and renaming
Added:
   sandbox/opaque/boost/opaque/meta_mixin/using_explicit_conversion_to_ut_hierarchy.hpp
      - copied unchanged from r70626, /sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp
   sandbox/opaque/boost/opaque/meta_mixin/using_implicit_conversion_to_ut_hierarchy.hpp
      - copied unchanged from r70626, /sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp
Removed:
   sandbox/opaque/boost/opaque/enum_class_macro.hpp
   sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp
   sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp
   sandbox/opaque/boost/opaque/opaque_type.hpp
Text files modified:
   sandbox/opaque/boost/opaque/private_opaque_class.hpp | 2 +-
   sandbox/opaque/boost/opaque/public_opaque_class.hpp | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)

Deleted: sandbox/opaque/boost/opaque/enum_class_macro.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/enum_class_macro.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
+++ (empty file)
@@ -1,124 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2011.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_ENUM_CLASS_MACRO_HPP
-#define BOOST_OPAQUE_ENUM_CLASS_MACRO_HPP
-
-#include <boost/enums/underlying_type.hpp>
-#include <boost/enums/enum_type.hpp>
-#include <boost/enums/default_value.hpp>
-#include <boost/enums/get_value.hpp>
-#include <boost/conversion/convert_to.hpp>
-#include <boost/config.hpp>
-#include <boost/preprocessor/join.hpp>
-#include <boost/preprocessor/if.hpp>
-#include <boost/preprocessor/greater.hpp>
-#include <boost/preprocessor/empty.hpp>
-#include <boost/preprocessor/seq/enum.hpp>
-#include <boost/preprocessor/seq/elem.hpp>
-
-#define BOOST_OPAQUE_DETAIL_PAIR_TO_LITERAL(R, DATA, OPTPAIR) \
- BOOST_PP_JOIN(BOOST_PP_SEQ_ELEM(PAIR,0),DATA) \
- BOOST_PP_IF(BOOST_PP_GREATER(BOOST_PP_SE_SIZE(PAIR),1), \
- = BOOST_PP_SEQ_ELEM(PAIR,1),BOOST_PP_EMPTY)
-
-#define BOOST_OPAQUE_DETAIL_OPTPAIR_TO_NAME(EC, OPTPAIR) \
- EC::BOOST_PP_SEQ_ELEM(PAIR,0)
-
-#define BOOST_OPAQUE_DETAIL_OPTPAIR_TO_INTERNAL_NAME(OPTPAIR) \
- EC::BOOST_PP_JOIN(BOOST_PP_SEQ_ELEM(PAIR,0),_)
-
-#define BOOST_OPAQUE_DETAIL_CONST_DECLARATION(R, EC, OPTPAIR) \
- const EC BOOST_OPAQUE_DETAIL_OPTPAIR_TO_NAME(EC, OPTPAIR) \
-
-
-#define BOOST_OPAQUE_DETAIL_CONST_DEFINITION(R, EC, OPTPAIR) \
- const EC BOOST_OPAQUE_DETAIL_OPTPAIR_TO_NAME(EC, OPTPAIR) \
- = EC::convert_to( \
- BOOST_OPAQUE_DETAIL_OPTPAIR_TO_INTERNAL_NAME(EC, OPTPAIR) \
- ;
-
-
-#ifndef BOOST_NO_ENUM_CLASS
-
-#define BOOST_ENUM_CLASS(EC, UT, SEQ) \
- enum class EC : UT { \
- BOOST_PP_SEQ_ENUM( \
- BOOST_PP_SEQ_FOR_EACH( \
- BOOST_OPAQUE_DETAIL_PAIR_TO_LITERAL, \
- BOOST_PP_EMPTY, \
- SEQ \
- ) \
- ) \
- };
-
-#else // BOOST_NO_ENUM_CLASS
-
-#define BOOST_ENUM_CLASS_CONSTRUCTORS(EC, UT) \
- EC() : val_() { } \
- EC(UT v) : val_(v) { }
-
-#define BOOST_ENUM_CLASS_EXT(EC, UT, SEQ, CONS) \
- class EC \
- { \
- public: \
- enum type { \
- BOOST_PP_SEQ_ENUM( \
- BOOST_PP_SEQ_FOR_EACH( \
- BOOST_OPAQUE_DETAIL_PAIR_TO_LITERAL, \
- _, \
- SEQ \
- ) \
- ) \
- }; \
- typedef UT underlying_type; \
- private: \
- underlying_type val_; \
- public: \
- BOOST_PP_SEQ_FOR_EACH( \
- BOOST_OPAQUE_DETAIL_CONST_DECLARATION, \
- EC, \
- SEQ \
- ) \
- BOOST_PP_IF(CONS, \
- BOOST_ENUM_CLASS_CONSTRUCTORS(EC, UT), \
- BOOST_PP_EMPTY \
- ) \
- static EC default_value() \
- { \
- EC res; \
- res.val_=EnumClass::type(); \
- return res; \
- } \
- static EC convert_to(underlying_type v) \
- { \
- EC res; \
- res.val_=type(v); \
- return res; \
- } \
- type get() const \
- { \
- return type(val_); \
- } \
- }; \
- BOOST_PP_SEQ_FOR_EACH( \
- BOOST_OPAQUE_DETAIL_CONST_DEFINITION, \
- EC, \
- SEQ \
- ) \
-
-
-#define BOOST_ENUM_CLASS(EC, UT, SEQ) \
- BOOST_ENUM_CLASS_EXT(EC, UT, SEQ, defined(BOOST_ENUMS_NO_CONSTRUCTORS))
-
-#endif // BOOST_NO_ENUM_CLASS
-#endif

Deleted: sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/transitive_explicit_substituable.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
+++ (empty file)
@@ -1,91 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
-#define BOOST_OPAQUE_TRANSITIVE_EXPLICIT_SUBSTITUABLE_HPP
-
-#include <boost/opaque/meta_mixin/combined_operators.hpp>
-
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/and.hpp>
-#include <boost/conversion/convert_to.hpp>
-
-namespace boost {
- namespace opaque {
-
-#if !defined(BOOST_OPAQUE_DOXYGEN_INVOKED)
- template <typename BaseClass, typename UT>
- struct using_explicit_conversion_to_underlying_type_hierarchy;
-
- namespace opaque_detail {
-
- template <
- typename BaseClass,
- typename Final,
- typename UT,
- typename Base,
- bool B>
- struct transitive_explicit_substituable_next_level;
-
- template <
- typename BaseClass,
- typename Final,
- typename UT,
- typename Base>
- struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, true>
- : using_explicit_conversion_to_underlying_type_hierarchy<BaseClass, typename UT::underlying_type>
- ::template type<Final, Base>
- {};
- template <
- typename BaseClass,
- typename Final,
- typename UT,
- typename Base
- >
- struct transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base, false>
- : Base
- {};
-
- }
-#endif
-
- //! mixin generating the explicit conversion to all the underlying types hierarchy.
- //! This meta-mixin provides the Final class explicit conversions for all the underlying types hierarchy
- //! (when the compiler supports explicit conversion operators).
- //! For portability purposed the library provide as workaround a @c convert_to non member function which follows the Boost.conversion protocol.
- template <typename BaseClass, typename UT>
- struct using_explicit_conversion_to_underlying_type_hierarchy {
- template <typename Final, typename Base>
- struct type
- : opaque_detail::transitive_explicit_substituable_next_level<BaseClass, Final, UT, Base,
- mpl::and_<is_class<UT>, is_base_of<BaseClass, UT> >::value>
- {
- friend UT convert_to(Final const& rhs,
- boost::dummy::type_tag<UT> const&)
- {
- return Final::final(&rhs).underlying();
- }
-#if !defined(BOOST_NO_EXPLICIT_CONVERSION_OPERATORS)
- explicit operator UT() const
- {
- return Final::final(this).underlying();
- }
-#endif
- };
- };
-
- }
-}
-
-
-#endif

Deleted: sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/meta_mixin/transitive_substituable.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
+++ (empty file)
@@ -1,74 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
-#define BOOST_OPAQUE_TRANSITIVE_SUBSTITUABLE_HPP
-
-#include <boost/type_traits/is_class.hpp>
-#include <boost/type_traits/is_base_of.hpp>
-#include <boost/mpl/and.hpp>
-
-namespace boost {
- namespace opaque {
-
- template <typename BaseClass, typename UT>
- struct using_implicit_conversion_to_underlying_type_hierarchy;
-
- namespace opaque_detail {
-
- template <
- typename BaseClass,
- typename Final,
- typename UT,
- typename Base,
- bool IsConvertible
- >
- struct transitive_substituable_next_level;
-
- template <
- typename BaseClass,
- typename Final,
- typename UT,
- typename Base
- >
- struct transitive_substituable_next_level<BaseClass, Final, UT, Base, true>
- : using_implicit_conversion_to_underlying_type_hierarchy<BaseClass, typename UT::underlying_type>
- ::template type<Final, Base>
- { };
-
- template <typename BaseClass, typename Final, typename UT, typename Base>
- struct transitive_substituable_next_level<BaseClass, Final, UT, Base, false>
- : Base
- { };
-
- }
-
- //! mixin generating the implicit conversion to all the underlying type hierarchy.
- template <typename BaseClass, typename UT>
- struct using_implicit_conversion_to_underlying_type_hierarchy {
- template <typename Final, typename Base>
- struct type
- : opaque_detail::transitive_substituable_next_level<
- BaseClass, Final, UT, Base,
- mpl::and_<is_class<UT>, is_base_of<BaseClass, UT>
- >::value>
- {
- operator UT() const {
- return Final::final(this).underlying();
- }
- };
- };
-
- }
-}
-
-#endif

Deleted: sandbox/opaque/boost/opaque/opaque_type.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/opaque_type.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
+++ (empty file)
@@ -1,25 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Vicente J. Botet Escriba 2010.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/opaque for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_OPAQUE_OPAQUE_TYPE_HPP
-#define BOOST_OPAQUE_OPAQUE_TYPE_HPP
-
-#include <boost/opaque/new_type.hpp>
-#include <boost/opaque/meta_mixin/combined_operators.hpp>
-
-namespace boost {
-
-
-}
-
-
-#endif

Modified: sandbox/opaque/boost/opaque/private_opaque_class.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/private_opaque_class.hpp (original)
+++ sandbox/opaque/boost/opaque/private_opaque_class.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
@@ -16,7 +16,7 @@
 
 
 #include <boost/opaque/meta_mixin/inherited_from_underlying.hpp>
-#include <boost/opaque/meta_mixin/transitive_explicit_substituable.hpp>
+#include <boost/opaque/meta_mixin/using_explicit_conversion_to_ut_hierarchy.hpp>
 
 #include <boost/type_traits/is_class.hpp>
 #include <boost/type_traits/is_base_of.hpp>

Modified: sandbox/opaque/boost/opaque/public_opaque_class.hpp
==============================================================================
--- sandbox/opaque/boost/opaque/public_opaque_class.hpp (original)
+++ sandbox/opaque/boost/opaque/public_opaque_class.hpp 2011-03-27 10:12:22 EDT (Sun, 27 Mar 2011)
@@ -14,7 +14,7 @@
 #define BOOST_OPAQUE_PUBLIC_OPAQUE_CLASS_HPP
 
 #include <boost/opaque/meta_mixin/inherited_from_underlying.hpp>
-#include <boost/opaque/meta_mixin/transitive_substituable.hpp>
+#include <boost/opaque/meta_mixin/using_implicit_conversion_to_ut_hierarchy.hpp>
 
 
 namespace boost {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk