Sha256: 00463dd1c70aeaaba05f88b36173963dfe41d1569852ed3fb37f7025c6f0a97a

Contents?: true

Size: 1.64 KB

Versions: 19

Compression:

Stored size: 1.64 KB

Contents

// Copyright David Abrahams 2006. 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)
#ifndef BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
# define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP

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

namespace boost { namespace concepts {

namespace detail
{ 

// Here we implement the metafunction that detects whether a
// constraints metafunction exists
  typedef char yes;
  typedef char (&no)[2];

  template <class Model, void (Model::*)()>
  struct wrap_constraints {};
    
#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) || defined(__CUDACC__)
  // Work around the following bogus error in Sun Studio 11, by
  // turning off the has_constraints function entirely:
  //    Error: complex expression not allowed in dependent template
  //    argument expression
  inline no has_constraints_(...);
#else
  template <class Model>
  inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
  inline no has_constraints_(...);
#endif
}

// This would be called "detail::has_constraints," but it has a strong
// tendency to show up in error messages.
template <class Model>
struct not_satisfied
{
    BOOST_STATIC_CONSTANT(
        bool
      , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
    typedef boost::integral_constant<bool, value> type;
};

}} // namespace boost::concepts::detail

#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
passenger-6.0.23 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.20 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.19 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.18 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.17 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.16 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.15 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.14 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.13 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.12 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.11 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.10 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.9 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.8 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.7 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.6 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.5 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.4 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp
passenger-6.0.3 src/cxx_supportlib/vendor-modified/boost/concept/detail/has_constraints.hpp