|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80881 - in sandbox/type_erasure: boost/type_erasure boost/type_erasure/detail libs/type_erasure/doc
From: steven_at_[hidden]
Date: 2012-10-05 19:36:22
Author: steven_watanabe
Date: 2012-10-05 19:36:21 EDT (Fri, 05 Oct 2012)
New Revision: 80881
URL: http://svn.boost.org/trac/boost/changeset/80881
Log:
MSVC doesn't like this use of default arguments. It fails to show the source of the error in user code. Move the checks back into the constructor init list.
Text files modified:
sandbox/type_erasure/boost/type_erasure/any.hpp | 63 ++++++++++++++++++++++++++-------------
sandbox/type_erasure/boost/type_erasure/binding.hpp | 14 ++++++--
sandbox/type_erasure/boost/type_erasure/detail/instantiate.hpp | 10 +-----
sandbox/type_erasure/libs/type_erasure/doc/Jamfile.jam | 2 -
4 files changed, 53 insertions(+), 36 deletions(-)
Modified: sandbox/type_erasure/boost/type_erasure/any.hpp
==============================================================================
--- sandbox/type_erasure/boost/type_erasure/any.hpp (original)
+++ sandbox/type_erasure/boost/type_erasure/any.hpp 2012-10-05 19:36:21 EDT (Fri, 05 Oct 2012)
@@ -171,12 +171,13 @@
* constructor of @c U throws.
*/
template<class U>
- explicit any(const U& data_arg, BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U))
- : table(
+ explicit any(const U& data_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U),
::boost::type_erasure::make_binding<
::boost::mpl::map< ::boost::mpl::pair<T, U> >
>()
- ),
+ )),
data(data_arg)
{}
/**
@@ -196,7 +197,10 @@
*/
template<class U, class Map>
any(const U& data_arg, const static_binding<Map>& binding_arg)
- : table(binding_arg),
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ )),
data(data_arg)
{
BOOST_MPL_ASSERT((::boost::is_same<
@@ -389,18 +393,27 @@
// disambiguating overloads
template<class U, class Map>
- any(U& data_arg, static_binding<Map>& binding_arg, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : table(binding_arg),
+ any(U& data_arg, static_binding<Map>& binding_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ )),
data(data_arg)
{}
template<class U, class Map>
- any(const U& data_arg, static_binding<Map>& binding_arg, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : table(binding_arg),
+ any(const U& data_arg, static_binding<Map>& binding_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ )),
data(data_arg)
{}
template<class U, class Map>
- any(U& data_arg, const static_binding<Map>& binding_arg, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : table(binding_arg),
+ any(U& data_arg, const static_binding<Map>& binding_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ )),
data(data_arg)
{}
template<class Concept2, class Tag2, class Map>
@@ -832,15 +845,15 @@
::boost::is_const<U>,
::boost::type_erasure::detail::is_any<U>
>
- >::type* = 0,
- BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U)
+ >::type* = 0
#endif
)
- : table(
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U),
::boost::type_erasure::make_binding<
::boost::mpl::map< ::boost::mpl::pair<T, U> >
>()
- )
+ ))
{
data.data = ::boost::addressof(arg);
}
@@ -858,9 +871,11 @@
* \throws Nothing.
*/
template<class U, class Map>
- any(U& arg, const static_binding<Map>& binding_arg,
- BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : table(binding_arg)
+ any(U& arg, const static_binding<Map>& binding_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ ))
{
BOOST_MPL_ASSERT((::boost::is_same<
typename ::boost::mpl::at<Map, T>::type, U>));
@@ -1223,12 +1238,13 @@
* \throws Nothing.
*/
template<class U>
- explicit any(const U& arg, BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U))
- : table(
+ explicit any(const U& arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U),
::boost::type_erasure::make_binding<
::boost::mpl::map< ::boost::mpl::pair<T, U> >
>()
- )
+ ))
{
data.data = const_cast<void*>(static_cast<const void*>(::boost::addressof(arg)));
}
@@ -1246,8 +1262,11 @@
* \throws Nothing.
*/
template<class U, class Map>
- any(const U& arg, const static_binding<Map>& binding_arg, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : table(binding_arg)
+ any(const U& arg, const static_binding<Map>& binding_arg)
+ : table((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ binding_arg
+ ))
{
BOOST_MPL_ASSERT((::boost::is_same<
typename ::boost::mpl::at<Map, T>::type, U>));
Modified: sandbox/type_erasure/boost/type_erasure/binding.hpp
==============================================================================
--- sandbox/type_erasure/boost/type_erasure/binding.hpp (original)
+++ sandbox/type_erasure/boost/type_erasure/binding.hpp 2012-10-05 19:36:21 EDT (Fri, 05 Oct 2012)
@@ -88,8 +88,11 @@
* \throws Nothing.
*/
template<class Map>
- explicit binding(const Map&, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : impl(static_binding<Map>())
+ explicit binding(const Map&)
+ : impl((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ static_binding<Map>()
+ ))
{}
/**
@@ -99,8 +102,11 @@
* \throws Nothing.
*/
template<class Map>
- binding(const static_binding<Map>&, BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map))
- : impl(static_binding<Map>())
+ binding(const static_binding<Map>&)
+ : impl((
+ BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map),
+ static_binding<Map>()
+ ))
{}
/**
Modified: sandbox/type_erasure/boost/type_erasure/detail/instantiate.hpp
==============================================================================
--- sandbox/type_erasure/boost/type_erasure/detail/instantiate.hpp (original)
+++ sandbox/type_erasure/boost/type_erasure/detail/instantiate.hpp 2012-10-05 19:36:21 EDT (Fri, 05 Oct 2012)
@@ -40,23 +40,17 @@
>::type type;
};
-struct instantiate_arg {};
-
#define BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map) \
- ::boost::type_erasure::detail::instantiate_arg = \
(::boost::type_erasure::detail::make_instantiate_concept< \
Concept \
- >::type::apply((Concept*)0, (Map*)0), \
- ::boost::type_erasure::detail::instantiate_arg())
+ >::type::apply((Concept*)0, (Map*)0))
#define BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, P0, T0) \
- ::boost::type_erasure::detail::instantiate_arg = \
(::boost::type_erasure::detail::make_instantiate_concept< \
Concept \
>::type::apply( \
(Concept*)0, \
- (::boost::mpl::map1< ::boost::mpl::pair<P0, T0> >*)0), \
- ::boost::type_erasure::detail::instantiate_arg())
+ (::boost::mpl::map1< ::boost::mpl::pair<P0, T0> >*)0))
#define BOOST_PP_FILENAME_1 <boost/type_erasure/detail/instantiate.hpp>
#define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPE_ERASURE_MAX_FUNCTIONS)
Modified: sandbox/type_erasure/libs/type_erasure/doc/Jamfile.jam
==============================================================================
--- sandbox/type_erasure/libs/type_erasure/doc/Jamfile.jam (original)
+++ sandbox/type_erasure/libs/type_erasure/doc/Jamfile.jam 2012-10-05 19:36:21 EDT (Fri, 05 Oct 2012)
@@ -37,8 +37,6 @@
\"BOOST_TYPE_ERASURE_UNARY_OPERATOR(name, op)=template<class T = _self, class R = T> struct name { static R apply(const T&); };\" \\
\"BOOST_TYPE_ERASURE_BINARY_OPERATOR(name, op)=template<class T = _self, class U = T, class R = T> struct name { static R apply(const T&, const U&); };\" \\
\"BOOST_TYPE_ERASURE_ASSIGNMENT_OPERATOR(name, op)=template<class T = _self, class U = T> struct name { static void apply(T&, const U&); };\" \\
- \"BOOST_TYPE_ERASURE_INSTANTIATE(Concept, Map)=\" \\
- \"BOOST_TYPE_ERASURE_INSTANTIATE1(Concept, T, U)=\" \\
\"table_arg=table\" \\
\"binding_arg=binding\" \\
\"data_arg=data\""
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