Skip to content

Commit

Permalink
Merge pull request #14 from boostorg/dependency
Browse files Browse the repository at this point in the history
Drop dependency on Boost.Mpl
  • Loading branch information
mjcaisse committed Sep 9, 2018
2 parents 7226a74 + bbf48ff commit ee943d0
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion include/boost/concept/assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define BOOST_CONCEPT_ASSERT_DWA2006430_HPP

# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/config/workaround.hpp>

// The old protocol used a constraints() member function in concept
// checking classes. If the compiler supports SFINAE, we can detect
Expand Down
6 changes: 3 additions & 3 deletions include/boost/concept/detail/general.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp>
# include <boost/mpl/if.hpp>
# include <boost/type_traits/conditional.hpp>
# endif

// This implementation works on Comeau and GCC, all the way back to
Expand Down Expand Up @@ -49,8 +49,8 @@ struct constraint

template <class Model>
struct requirement_<void(*)(Model)>
: mpl::if_<
concepts::not_satisfied<Model>
: boost::conditional<
concepts::not_satisfied<Model>::value
, constraint<Model>
, requirement<failed ************ Model::************>
>::type
Expand Down
6 changes: 3 additions & 3 deletions include/boost/concept/detail/has_constraints.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifndef BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
# define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP

# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/type_traits/integral_constant.hpp>
# include <boost/config/workaround.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>

namespace boost { namespace concepts {
Expand Down Expand Up @@ -42,7 +42,7 @@ struct not_satisfied
BOOST_STATIC_CONSTANT(
bool
, value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
typedef mpl::bool_<value> type;
typedef boost::integral_constant<bool, value> type;
};

}} // namespace boost::concepts::detail
Expand Down
4 changes: 2 additions & 2 deletions include/boost/concept/detail/msvc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp>
# include <boost/mpl/if.hpp>
# include <boost/type_traits/conditional.hpp>
# endif

# ifdef BOOST_MSVC
Expand Down Expand Up @@ -54,7 +54,7 @@ namespace detail

template <class Model>
struct require
: mpl::if_c<
: boost::conditional<
not_satisfied<Model>::value
, detail::constraint
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
Expand Down
2 changes: 1 addition & 1 deletion include/boost/concept/usage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define BOOST_CONCEPT_USAGE_DWA2006919_HPP

# include <boost/concept/assert.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/config/workaround.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>

namespace boost { namespace concepts {
Expand Down
1 change: 0 additions & 1 deletion include/boost/concept_archetype.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#define BOOST_CONCEPT_ARCHETYPES_HPP

#include <boost/config.hpp>
#include <boost/mpl/identity.hpp>
#include <functional>
#include <iterator> // iterator tags
#include <cstddef> // std::ptrdiff_t
Expand Down
22 changes: 11 additions & 11 deletions include/boost/concept_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
# include <utility>
# include <boost/type_traits/is_same.hpp>
# include <boost/type_traits/is_void.hpp>
# include <boost/mpl/assert.hpp>
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/static_assert.hpp>
# include <boost/type_traits/integral_constant.hpp>
# include <boost/config/workaround.hpp>

# include <boost/concept/usage.hpp>
# include <boost/concept/detail/concept_def.hpp>
Expand Down Expand Up @@ -301,14 +301,14 @@ namespace boost
BOOST_CONCEPT_USAGE(Generator) { test(is_void<Return>()); }

private:
void test(boost::mpl::false_)
void test(boost::false_type)
{
// Do we really want a reference here?
const Return& r = f();
ignore_unused_variable_warning(r);
}

void test(boost::mpl::true_)
void test(boost::true_type)
{
f();
}
Expand All @@ -321,14 +321,14 @@ namespace boost
BOOST_CONCEPT_USAGE(UnaryFunction) { test(is_void<Return>()); }

private:
void test(boost::mpl::false_)
void test(boost::false_type)
{
f(arg); // "priming the pump" this way keeps msvc6 happy (ICE)
Return r = f(arg);
ignore_unused_variable_warning(r);
}

void test(boost::mpl::true_)
void test(boost::true_type)
{
f(arg);
}
Expand All @@ -350,14 +350,14 @@ namespace boost
{
BOOST_CONCEPT_USAGE(BinaryFunction) { test(is_void<Return>()); }
private:
void test(boost::mpl::false_)
void test(boost::false_type)
{
f(first,second);
Return r = f(first, second); // require operator()
(void)r;
}

void test(boost::mpl::true_)
void test(boost::true_type)
{
f(first,second);
}
Expand Down Expand Up @@ -966,7 +966,7 @@ namespace boost
{
typedef typename C::key_type key_type;
typedef typename C::value_type value_type;
BOOST_MPL_ASSERT((boost::is_same<key_type,value_type>));
BOOST_STATIC_ASSERT((boost::is_same<key_type,value_type>::value));
}
};

Expand All @@ -979,7 +979,7 @@ namespace boost
typedef typename C::value_type value_type;
typedef typename C::mapped_type mapped_type;
typedef std::pair<const key_type, mapped_type> required_value_type;
BOOST_MPL_ASSERT((boost::is_same<value_type,required_value_type>));
BOOST_STATIC_ASSERT((boost::is_same<value_type,required_value_type>::value));
}
};

Expand Down
4 changes: 2 additions & 2 deletions include/boost/concept_check/general.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept_check/has_constraints.hpp>
# include <boost/mpl/if.hpp>
# include <boost/type_traits/conditional.hpp>
# endif


Expand Down Expand Up @@ -54,7 +54,7 @@ namespace boost

template <class Model>
struct concept_check_<void(*)(Model)>
: mpl::if_c<
: conditional<
concept_checking::has_constraints<Model>::value
, constraint_check<Model>
, concept_check<Model>
Expand Down
4 changes: 2 additions & 2 deletions include/boost/concept_check/msvc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept_check/has_constraints.hpp>
# include <boost/mpl/if.hpp>
# include <boost/type_traits/conditional.hpp>
# endif


Expand Down Expand Up @@ -40,7 +40,7 @@ namespace boost

template <class Model>
struct concept_check
: mpl::if_c<
: conditional<
concept_checking::has_constraints<Model>::value
, concept_checking::constraint_check<Model>
, concept_checking::concept_check_<Model>
Expand Down

0 comments on commit ee943d0

Please sign in to comment.