forked from boostorg/concept_check
Workarounds for a nasty vc-7.1 bug that only shows up in the iterator
library tests. [SVN r33866]
This commit is contained in:
@@ -11,52 +11,80 @@
|
|||||||
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
template <class Model>
|
namespace concept_checking
|
||||||
struct concept_check
|
|
||||||
{
|
{
|
||||||
virtual void failed(Model* x)
|
template <class Model>
|
||||||
{
|
struct concept_check_
|
||||||
x->~Model();
|
{
|
||||||
}
|
virtual void failed(Model* x)
|
||||||
|
{
|
||||||
int test;
|
x->~Model();
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
# ifdef BOOST_OLD_CONCEPT_SUPPORT
|
# ifdef BOOST_OLD_CONCEPT_SUPPORT
|
||||||
|
|
||||||
template <class Model>
|
namespace concept_checking
|
||||||
struct constraint_check
|
|
||||||
{
|
{
|
||||||
virtual void failed(Model* x)
|
template <class Model>
|
||||||
{
|
struct constraint_check
|
||||||
x->constraints();
|
{
|
||||||
}
|
virtual void failed(Model* x)
|
||||||
|
{
|
||||||
|
x->constraints();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Model>
|
||||||
|
struct concept_check
|
||||||
|
: mpl::if_c<
|
||||||
|
concept_checking::has_constraints<Model>::value
|
||||||
|
, concept_checking::constraint_check<Model>
|
||||||
|
, concept_checking::concept_check_<Model>
|
||||||
|
>::type
|
||||||
|
{};
|
||||||
|
|
||||||
int test;
|
# else
|
||||||
};
|
|
||||||
|
|
||||||
template <class Model>
|
template <class Model>
|
||||||
typename mpl::if_c<
|
struct concept_check
|
||||||
concept_checking::has_constraints<Model>::value
|
: concept_checking::concept_check_<Model>
|
||||||
, constraint_check<Model>
|
{};
|
||||||
, concept_check<Model>
|
|
||||||
>::type concept_check_(void(*)(Model));
|
# endif
|
||||||
|
|
||||||
|
# if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||||
|
|
||||||
|
//
|
||||||
|
// The iterator library sees some really strange errors unless we
|
||||||
|
// use partial specialization to extract the model type with
|
||||||
|
// msvc-7.1
|
||||||
|
//
|
||||||
|
template <class Model>
|
||||||
|
struct concept_check<void(*)(Model)>
|
||||||
|
: concept_check<Model>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
||||||
|
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
||||||
|
sizeof(::boost::concept_check<void(*) ModelInParens>) \
|
||||||
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
|
||||||
template <class Model>
|
template <class Model>
|
||||||
concept_check<Model> concept_check_(void(*)(Model));
|
concept_check<Model>
|
||||||
|
concept_check_(void(*)(Model));
|
||||||
|
|
||||||
# endif
|
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
||||||
|
|
||||||
// Usage, in class or function context:
|
|
||||||
//
|
|
||||||
// BOOST_CONCEPT_ASSERT((UnaryFunctionConcept<F,bool,int>));
|
|
||||||
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
|
||||||
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
||||||
sizeof(boost::concept_check_((void(*) ModelInParens)0).test) \
|
sizeof(::boost::concept_check_((void(*) ModelInParens)0)) \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
|
#endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
|
||||||
|
@@ -11,52 +11,80 @@
|
|||||||
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
template <class Model>
|
namespace concept_checking
|
||||||
struct concept_check
|
|
||||||
{
|
{
|
||||||
virtual void failed(Model* x)
|
template <class Model>
|
||||||
{
|
struct concept_check_
|
||||||
x->~Model();
|
{
|
||||||
}
|
virtual void failed(Model* x)
|
||||||
|
{
|
||||||
int test;
|
x->~Model();
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
# ifdef BOOST_OLD_CONCEPT_SUPPORT
|
# ifdef BOOST_OLD_CONCEPT_SUPPORT
|
||||||
|
|
||||||
template <class Model>
|
namespace concept_checking
|
||||||
struct constraint_check
|
|
||||||
{
|
{
|
||||||
virtual void failed(Model* x)
|
template <class Model>
|
||||||
{
|
struct constraint_check
|
||||||
x->constraints();
|
{
|
||||||
}
|
virtual void failed(Model* x)
|
||||||
|
{
|
||||||
|
x->constraints();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
template <class Model>
|
||||||
|
struct concept_check
|
||||||
|
: mpl::if_c<
|
||||||
|
concept_checking::has_constraints<Model>::value
|
||||||
|
, concept_checking::constraint_check<Model>
|
||||||
|
, concept_checking::concept_check_<Model>
|
||||||
|
>::type
|
||||||
|
{};
|
||||||
|
|
||||||
int test;
|
# else
|
||||||
};
|
|
||||||
|
|
||||||
template <class Model>
|
template <class Model>
|
||||||
typename mpl::if_c<
|
struct concept_check
|
||||||
concept_checking::has_constraints<Model>::value
|
: concept_checking::concept_check_<Model>
|
||||||
, constraint_check<Model>
|
{};
|
||||||
, concept_check<Model>
|
|
||||||
>::type concept_check_(void(*)(Model));
|
# endif
|
||||||
|
|
||||||
|
# if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||||
|
|
||||||
|
//
|
||||||
|
// The iterator library sees some really strange errors unless we
|
||||||
|
// use partial specialization to extract the model type with
|
||||||
|
// msvc-7.1
|
||||||
|
//
|
||||||
|
template <class Model>
|
||||||
|
struct concept_check<void(*)(Model)>
|
||||||
|
: concept_check<Model>
|
||||||
|
{ };
|
||||||
|
|
||||||
|
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
||||||
|
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
||||||
|
sizeof(::boost::concept_check<void(*) ModelInParens>) \
|
||||||
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
|
|
||||||
template <class Model>
|
template <class Model>
|
||||||
concept_check<Model> concept_check_(void(*)(Model));
|
concept_check<Model>
|
||||||
|
concept_check_(void(*)(Model));
|
||||||
|
|
||||||
# endif
|
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
||||||
|
|
||||||
// Usage, in class or function context:
|
|
||||||
//
|
|
||||||
// BOOST_CONCEPT_ASSERT((UnaryFunctionConcept<F,bool,int>));
|
|
||||||
# define BOOST_CONCEPT_ASSERT( ModelInParens ) \
|
|
||||||
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
enum { BOOST_PP_CAT(boost_concept_check,__LINE__) = \
|
||||||
sizeof(boost::concept_check_((void(*) ModelInParens)0).test) \
|
sizeof(::boost::concept_check_((void(*) ModelInParens)0)) \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
|
#endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
|
||||||
|
Reference in New Issue
Block a user