]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | |
2 | // (C) Copyright John Maddock 2000. | |
3 | // Use, modification and distribution are subject to the | |
4 | // Boost Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ||
7 | #include <boost/type_traits/is_void.hpp> | |
8 | #include <boost/mpl/if.hpp> | |
9 | #include <boost/static_assert.hpp> | |
10 | ||
11 | template <class T> | |
12 | struct if_test | |
13 | { | |
14 | typedef typename boost::mpl::if_< | |
15 | boost::is_void<T>, | |
16 | int, T>::type type; | |
17 | }; | |
18 | ||
19 | if_test<void>::type t1 = 0; | |
20 | if_test<double>::type t2 = 0; | |
21 | ||
22 | int main() | |
23 | { | |
24 | return (int)(t1 + t2); | |
b32b8144 | 25 | } |