mirror of
https://github.com/boostorg/typeof.git
synced 2025-11-17 16:09:27 +01:00
36 lines
925 B
C++
Executable File
36 lines
925 B
C++
Executable File
// Copyright (C) 2005 Arkadiy Vertleyb
|
|
// Use, modification and distribution is subject to the Boost Software
|
|
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
#ifndef BOOST_TYPEOF_TEST_HPP_INCLUDED
|
|
#define BOOST_TYPEOF_TEST_HPP_INCLUDED
|
|
|
|
#include <boost/typeof/typeof.hpp>
|
|
#include <boost/type_traits/is_same.hpp>
|
|
#include <boost/static_assert.hpp>
|
|
|
|
namespace boost { namespace type_of {
|
|
|
|
template<class T>
|
|
struct test_wrapper{};
|
|
|
|
template<class T>
|
|
test_wrapper<T> test_helper(test_wrapper<T>*);
|
|
|
|
template<class T>
|
|
struct test
|
|
{
|
|
enum {value = boost::is_same<
|
|
BOOST_TYPEOF_TPL(test_helper(reinterpret_cast<test_wrapper<T>*>(0))),
|
|
test_wrapper<T>
|
|
>::value
|
|
};
|
|
};
|
|
|
|
}}
|
|
|
|
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
|
|
BOOST_TYPEOF_REGISTER_TEMPLATE(boost::type_of::test_wrapper, 1)
|
|
|
|
#endif//BOOST_TYPEOF_TEST_HPP_INCLUDED
|