Chris@16
|
1 /* Copyright 2003-2008 Joaquin M Lopez Munoz.
|
Chris@16
|
2 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
3 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
4 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5 *
|
Chris@16
|
6 * See http://www.boost.org/libs/multi_index for library home page.
|
Chris@16
|
7 */
|
Chris@16
|
8
|
Chris@16
|
9 #ifndef BOOST_MULTI_INDEX_DETAIL_MSVC_INDEX_SPECIFIER_HPP
|
Chris@16
|
10 #define BOOST_MULTI_INDEX_DETAIL_MSVC_INDEX_SPECIFIER_HPP
|
Chris@16
|
11
|
Chris@16
|
12 #if defined(_MSC_VER)&&(_MSC_VER>=1200)
|
Chris@16
|
13 #pragma once
|
Chris@16
|
14 #endif
|
Chris@16
|
15
|
Chris@16
|
16 #include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
|
Chris@16
|
17 #include <boost/detail/workaround.hpp>
|
Chris@16
|
18
|
Chris@16
|
19 #if BOOST_WORKAROUND(BOOST_MSVC,<1310)
|
Chris@16
|
20 /* Workaround for a problem in MSVC with dependent template typedefs
|
Chris@16
|
21 * when accesing index specifiers.
|
Chris@16
|
22 * Modeled after <boost/mpl/aux_/msvc_dtw.hpp> (thanks, Aleksey!)
|
Chris@16
|
23 */
|
Chris@16
|
24
|
Chris@16
|
25 #include <boost/mpl/aux_/msvc_never_true.hpp>
|
Chris@16
|
26
|
Chris@16
|
27 namespace boost{
|
Chris@16
|
28
|
Chris@16
|
29 namespace multi_index{
|
Chris@16
|
30
|
Chris@16
|
31 namespace detail{
|
Chris@16
|
32
|
Chris@16
|
33 template<typename IndexSpecifier>
|
Chris@16
|
34 struct msvc_index_specifier
|
Chris@16
|
35 {
|
Chris@16
|
36 template<bool> struct fake_index_type:IndexSpecifier{};
|
Chris@16
|
37 template<> struct fake_index_type<true>
|
Chris@16
|
38 {
|
Chris@16
|
39 template<typename Super>
|
Chris@16
|
40 struct node_class{};
|
Chris@16
|
41
|
Chris@16
|
42 template<typename Super>
|
Chris@16
|
43 struct index_class{};
|
Chris@16
|
44 };
|
Chris@16
|
45
|
Chris@16
|
46 template<typename Super>
|
Chris@16
|
47 struct result_node_class:
|
Chris@16
|
48 fake_index_type<mpl::aux::msvc_never_true<IndexSpecifier>::value>::
|
Chris@16
|
49 template node_class<Super>
|
Chris@16
|
50 {
|
Chris@16
|
51 };
|
Chris@16
|
52
|
Chris@16
|
53 template<typename Super>
|
Chris@16
|
54 struct result_index_class:
|
Chris@16
|
55 fake_index_type<mpl::aux::msvc_never_true<IndexSpecifier>::value>::
|
Chris@16
|
56 template index_class<Super>
|
Chris@16
|
57 {
|
Chris@16
|
58 };
|
Chris@16
|
59 };
|
Chris@16
|
60
|
Chris@16
|
61 } /* namespace multi_index::detail */
|
Chris@16
|
62
|
Chris@16
|
63 } /* namespace multi_index */
|
Chris@16
|
64
|
Chris@16
|
65 } /* namespace boost */
|
Chris@16
|
66
|
Chris@16
|
67 #endif /* workaround */
|
Chris@16
|
68
|
Chris@16
|
69 #endif
|