diff --git a/include/boost/detail/in_place_factory.hpp b/include/boost/detail/in_place_factory.hpp deleted file mode 100644 index f22b4e4..0000000 --- a/include/boost/detail/in_place_factory.hpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// -// Use, modification, and distribution is subject to 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/lib/optional for documentation. -// -// You are welcome to contact the author at: -// fernando_cacciola@hotmail.com -// -#ifndef BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP -#define BOOST_UTILITY_INPLACE_FACTORY_25AGO2003_HPP - -#include - -#include - -namespace boost { - -class InPlaceFactoryBase {} ; - -#define BOOST_DEFINE_INPLACE_FACTORY_CLASS(z,n,_) \ -template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ -class BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) : public InPlaceFactoryBase \ -{ \ -public: \ -\ - BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \ - : \ - BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \ - {} \ -\ - template \ - void apply ( void* address BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T) ) const \ - { \ - new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \ - } \ -\ - BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \ -} ; \ -\ -template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ -BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ -in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \ -{ \ - return BOOST_PP_CAT(InPlaceFactory, BOOST_PP_INC(n) ) < BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ - ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \ -} ; \ - -BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() ) - -} // namespace boost - -#endif - diff --git a/include/boost/detail/in_place_factory_prefix.hpp b/include/boost/detail/in_place_factory_prefix.hpp deleted file mode 100644 index 65001e8..0000000 --- a/include/boost/detail/in_place_factory_prefix.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// -// Use, modification, and distribution is subject to 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/lib/optional for documentation. -// -// You are welcome to contact the author at: -// fernando_cacciola@hotmail.com -// -#ifndef BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP -#define BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP - -#include -#include -#include -#include -#include -#include -#include -#include - -#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT(z,n,_) BOOST_PP_CAT(m_a,n) BOOST_PP_LPAREN() BOOST_PP_CAT(a,n) BOOST_PP_RPAREN() -#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL(z,n,_) BOOST_PP_CAT(A,n) const& BOOST_PP_CAT(m_a,n); -#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG(z,n,_) BOOST_PP_CAT(m_a,n) - -#define BOOST_MAX_INPLACE_FACTORY_ARITY 10 - -#undef BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP - -#endif - diff --git a/include/boost/detail/in_place_factory_suffix.hpp b/include/boost/detail/in_place_factory_suffix.hpp deleted file mode 100644 index 20fc14a..0000000 --- a/include/boost/detail/in_place_factory_suffix.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// -// Use, modification, and distribution is subject to 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/lib/optional for documentation. -// -// You are welcome to contact the author at: -// fernando_cacciola@hotmail.com -// -#ifndef BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP -#define BOOST_UTILITY_INPLACE_FACTORY_SUFFIX_25AGO2003_HPP - -#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT -#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL -#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_ARG -#undef BOOST_MAX_INPLACE_FACTORY_ARITY - -#undef BOOST_UTILITY_INPLACE_FACTORY_PREFIX_25AGO2003_HPP - -#endif - diff --git a/include/boost/detail/typed_in_place_factory.hpp b/include/boost/detail/typed_in_place_factory.hpp deleted file mode 100644 index 2b01af9..0000000 --- a/include/boost/detail/typed_in_place_factory.hpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) 2003, Fernando Luis Cacciola Carballal. -// -// Use, modification, and distribution is subject to 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/lib/optional for documentation. -// -// You are welcome to contact the author at: -// fernando_cacciola@hotmail.com -// -#ifndef BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP -#define BOOST_UTILITY_TYPED_INPLACE_FACTORY_25AGO2003_HPP - -#include - -namespace boost { - -class TypedInPlaceFactoryBase {} ; - -#define BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS(z,n,_) \ -template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ -class BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) : public TypedInPlaceFactoryBase \ -{ \ -public: \ -\ - typedef T value_type ; \ -\ - BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A,const& a) ) \ - : \ - BOOST_PP_ENUM( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _ ) \ - {} \ -\ - void apply ( void* address ) const \ - { \ - new ( address ) T ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), m_a ) ) ; \ - } \ -\ - BOOST_PP_REPEAT( BOOST_PP_INC(n), BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _) \ -} ; \ -\ -template< class T, BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n),class A) > \ -BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) < T , BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ -in_place ( BOOST_PP_ENUM_BINARY_PARAMS(BOOST_PP_INC(n),A, const& a) ) \ -{ \ - return BOOST_PP_CAT(TypedInPlaceFactory, BOOST_PP_INC(n) ) < T, BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), A ) > \ - ( BOOST_PP_ENUM_PARAMS( BOOST_PP_INC(n), a ) ) ; \ -} ; \ - -BOOST_PP_REPEAT( BOOST_MAX_INPLACE_FACTORY_ARITY, BOOST_DEFINE_TYPED_INPLACE_FACTORY_CLASS, BOOST_PP_EMPTY() ) - -} // namespace boost - -#include - -#endif - diff --git a/include/boost/optional/optional.hpp b/include/boost/optional/optional.hpp index 3a34f41..7379d80 100644 --- a/include/boost/optional/optional.hpp +++ b/include/boost/optional/optional.hpp @@ -77,8 +77,8 @@ namespace boost { -class InPlaceFactoryBase ; -class TypedInPlaceFactoryBase ; +class in_place_factory_base ; +class typed_in_place_factory_base ; namespace optional_detail { @@ -143,7 +143,7 @@ class optional_base : public optional_tag protected : typedef T value_type ; - + typedef mpl::true_ is_reference_tag ; typedef mpl::false_ is_not_reference_tag ; @@ -190,7 +190,7 @@ class optional_base : public optional_tag construct(rhs.get_impl()); } - + // This is used for both converting and in-place constructions. // Derived classes use the 'tag' to select the appropriate // implementation (the correct 'construct()' overload) @@ -202,8 +202,8 @@ class optional_base : public optional_tag construct(expr,tag); } - - + + // No-throw (assuming T::~T() doesn't) ~optional_base() { destroy() ; } @@ -227,10 +227,10 @@ class optional_base : public optional_tag // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED // No-throw (assuming T::~T() doesn't) void assign ( detail::none_t const& ) { destroy(); } - + #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT template - void assign_expr ( Expr const& expr, Expr const* tag ) + void assign_expr ( Expr const& expr, Expr const* tag ) { destroy(); construct(expr,tag); @@ -266,7 +266,7 @@ class optional_base : public optional_tag #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT // Constructs in-place using the given factory template - void construct ( Expr const& factory, InPlaceFactoryBase const* ) + void construct ( Expr const& factory, in_place_factory_base const* ) { BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; factory.BOOST_NESTED_TEMPLATE apply(m_storage.address()) ; @@ -275,7 +275,7 @@ class optional_base : public optional_tag // Constructs in-place using the given typed factory template - void construct ( Expr const& factory, TypedInPlaceFactoryBase const* ) + void construct ( Expr const& factory, typed_in_place_factory_base const* ) { BOOST_STATIC_ASSERT ( ::boost::mpl::not_::value ) ; factory.apply(m_storage.address()) ; @@ -375,7 +375,7 @@ class optional : public optional_detail::optional_base typedef BOOST_DEDUCED_TYPENAME base::unspecified_bool_type unspecified_bool_type ; public : - + typedef optional this_type ; typedef BOOST_DEDUCED_TYPENAME base::value_type value_type ; @@ -397,7 +397,7 @@ class optional : public optional_detail::optional_base // Can throw if T::T(T const&) does optional ( argument_type val ) : base(val) {} - + #ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR // NOTE: MSVC needs templated versions first @@ -431,7 +431,7 @@ class optional : public optional_detail::optional_base // Creates a deep copy of another optional // Can throw if T::T(T const&) does optional ( optional const& rhs ) : base(rhs) {} - + // No-throw (assuming T::~T() doesn't) ~optional() {} diff --git a/test/optional_test_inplace.cpp b/test/optional_test_inplace.cpp index b56ad1c..c6a210c 100644 --- a/test/optional_test_inplace.cpp +++ b/test/optional_test_inplace.cpp @@ -15,11 +15,11 @@ #define BOOST_ENABLE_ASSERT_HANDLER -#include "boost/optional.hpp" +#include "boost/optional/optional.hpp" #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT -#include "boost/detail/in_place_factory.hpp" -#include "boost/detail/typed_in_place_factory.hpp" +#include "boost/utility/in_place_factory.hpp" +#include "boost/utility/typed_in_place_factory.hpp" #endif #ifdef __BORLANDC__ diff --git a/test/optional_test_inplace_fail.cpp b/test/optional_test_inplace_fail.cpp index 2b75410..c6ba1d6 100644 --- a/test/optional_test_inplace_fail.cpp +++ b/test/optional_test_inplace_fail.cpp @@ -15,10 +15,10 @@ #define BOOST_ENABLE_ASSERT_HANDLER -#include "boost/optional.hpp" +#include "boost/optional/optional.hpp" #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT -#include "boost/detail/in_place_factory.hpp" +#include "boost/utility/in_place_factory.hpp" #endif #ifdef __BORLANDC__ diff --git a/test/optional_test_inplace_fail2.cpp b/test/optional_test_inplace_fail2.cpp index 8435a56..f82d857 100644 --- a/test/optional_test_inplace_fail2.cpp +++ b/test/optional_test_inplace_fail2.cpp @@ -15,10 +15,10 @@ #define BOOST_ENABLE_ASSERT_HANDLER -#include "boost/optional.hpp" +#include "boost/optional/optional.hpp" #ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT -#include "boost/detail/typed_in_place_factory.hpp" +#include "boost/utility/typed_in_place_factory.hpp" #endif #ifdef __BORLANDC__