PageRenderTime 8ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/multi_index/detail/prevent_eti.hpp

http://hadesmem.googlecode.com/
C++ Header | 60 lines | 36 code | 13 blank | 11 comment | 0 complexity | de37469b33ac5504df5b2daef2a86c80 MD5 | raw file
 1/* Copyright 2003-2008 Joaquin M Lopez Munoz.
 2 * Distributed under the Boost Software License, Version 1.0.
 3 * (See accompanying file LICENSE_1_0.txt or copy at
 4 * http://www.boost.org/LICENSE_1_0.txt)
 5 *
 6 * See http://www.boost.org/libs/multi_index for library home page.
 7 */
 8
 9#ifndef BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
10#define BOOST_MULTI_INDEX_DETAIL_PREVENT_ETI_HPP
11
12#if defined(_MSC_VER)&&(_MSC_VER>=1200)
13#pragma once
14#endif
15
16#include <boost/config.hpp> /* keep it first to prevent nasty warns in MSVC */
17#include <boost/detail/workaround.hpp>
18
19#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
20#include <boost/mpl/if.hpp>
21#include <boost/mpl/integral_c.hpp>
22#include <boost/mpl/aux_/msvc_never_true.hpp>
23#endif
24
25namespace boost{
26
27namespace multi_index{
28
29namespace detail{
30
31#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
32/* See
33 * http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Effective_MPL
34 * Item 5.6, Beware of the 'early template instantiation' trap.
35 */
36
37template<typename Type,typename Construct>
38struct prevent_eti
39{
40  typedef typename mpl::if_<
41    mpl::aux::msvc_never_true<Type>,
42    mpl::integral_c<int,0>,
43    Construct
44  >::type type;
45};
46#else
47template<typename Type,typename Construct>
48struct prevent_eti
49{
50  typedef Construct type;
51};
52#endif
53
54} /* namespace multi_index::detail */
55
56} /* namespace multi_index */
57
58} /* namespace boost */
59
60#endif