noncopyable.cpp 669 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2009-2012 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0
  3. // (see accompanying file LICENSE_1_0.txt or a copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Home at http://www.boost.org/libs/utility/identity_type
  6. #include <boost/utility/identity_type.hpp>
  7. #include <boost/static_assert.hpp>
  8. #include <boost/noncopyable.hpp>
  9. //[noncopyable
  10. #define TMP_ASSERT(metafunction) \
  11. BOOST_STATIC_ASSERT(metafunction::value)
  12. template<typename T, T init>
  13. struct noncopyable : boost::noncopyable {
  14. static const T value = init;
  15. };
  16. TMP_ASSERT(BOOST_IDENTITY_TYPE((noncopyable<bool, true>)));
  17. //]
  18. int main() { return 0; }