blob: dabc9758d60235b5a2613d68753f5a0fdf9d7333 [file] [log] [blame]
Jeff Thompsonf7d49942013-08-01 16:47:40 -07001// Copyright (C) 2004 Peder Holt
2// Use, modification and distribution is subject to the Boost Software
3// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
4
5#ifndef BOOST_TYPETRAITS_MSVC_TYPEOF_HPP
6#define BOOST_TYPETRAITS_MSVC_TYPEOF_HPP
7
Jeff Thompson2277ce52013-08-01 17:34:11 -07008#include <ndnboost/config.hpp>
9#include <ndnboost/detail/workaround.hpp>
Jeff Thompsonf7d49942013-08-01 16:47:40 -070010
11namespace ndnboost { namespace detail {
12# if BOOST_WORKAROUND(BOOST_MSVC,==1300)
13 template<typename ID>
14 struct msvc_extract_type
15 {
16 template<bool>
17 struct id2type_impl;
18
19 typedef id2type_impl<true> id2type;
20 };
21
22 template<typename T, typename ID>
23 struct msvc_register_type : public msvc_extract_type<ID>
24 {
25 template<>
26 struct id2type_impl<true> //VC7.0 specific bugfeature
27 {
28 typedef T type;
29 };
30 };
31# else
32 template<typename ID>
33 struct msvc_extract_type
34 {
35 struct id2type;
36 };
37
38 template<typename T, typename ID>
39 struct msvc_register_type : public msvc_extract_type<ID>
40 {
41 typedef msvc_extract_type<ID> base_type;
42 struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature
43 {
44 typedef T type;
45 };
46 };
47# endif
48}}
49
50#endif //BOOST_TYPETRAITS_MSVC_TYPEOF_IMPL_HPP