1// Boost.Units - A C++ library for zero-overhead dimensional analysis and
2// unit/quantity manipulation and conversion
3//
4// Copyright (C) 2003-2008 Matthias Christian Schabel
5// Copyright (C) 2007-2008 Steven Watanabe
6//
7// Distributed under the Boost Software License, Version 1.0. (See
8// accompanying file LICENSE_1_0.txt or copy at
9// http://www.boost.org/LICENSE_1_0.txt)
10
11#ifndef BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP
12#define BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP
13
14#include <boost/mpl/long.hpp>
15
16namespace boost {
17
18namespace units {
19
20namespace detail {
21
22struct no { BOOST_CONSTEXPR no() : dummy() {} char dummy; };
23struct yes { no dummy[2]; };
24
25template<bool> struct ordinal_has_already_been_defined;
26
27template<>
28struct ordinal_has_already_been_defined<true> { };
29
30template<>
31struct ordinal_has_already_been_defined<false> { typedef void type; };
32
33}
34
35/// This must be in namespace boost::units so that ADL
36/// will work. we need a mangled name because it must
37/// be found by ADL
38/// INTERNAL ONLY
39template<class T>
40BOOST_CONSTEXPR
41detail::no
42boost_units_is_registered(const T&)
43{ return(detail::no()); }
44
45/// INTERNAL ONLY
46template<class T>
47BOOST_CONSTEXPR
48detail::no
49boost_units_unit_is_registered(const T&)
50{ return(detail::no()); }
51
52} // namespace units
53
54} // namespace boost
55
56#endif // BOOST_UNITS_PREVENT_ORDINAL_REDEFINITION_IMPL_HPP
57

source code of boost/libs/units/include/boost/units/detail/prevent_redefinition.hpp