source: NonGTP/Boost/boost/multi_index/detail/def_ctor_tuple_cons.hpp @ 857

Revision 857, 1.4 KB checked in by igarcia, 18 years ago (diff)
Line 
1/* Copyright 2003-2005 Joaquín M López Muñoz.
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_DEF_CTOR_TUPLE_CONS_HPP
10#define BOOST_MULTI_INDEX_DETAIL_DEF_CTOR_TUPLE_CONS_HPP
11
12#if defined(_MSC_VER)&&(_MSC_VER>=1200)
13#pragma once
14#endif
15
16#include <boost/config.hpp>
17
18#if defined(BOOST_MSVC)
19/* In MSVC, tuples::cons is not default constructible. We provide a
20 * tiny wrapper around tuple::cons filling that hole.
21 */
22
23#include <boost/tuple/tuple.hpp>
24
25namespace boost{
26
27namespace multi_index{
28
29namespace detail{
30
31template<typename Cons>
32struct default_constructible_tuple_cons:Cons
33{
34  default_constructible_tuple_cons():
35    Cons(
36      Cons::head_type(),
37      static_cast<const Cons::tail_type&>(
38        default_constructible_tuple_cons<Cons::tail_type>()))
39  {}
40
41  default_constructible_tuple_cons(const Cons& cons):Cons(cons){}
42};
43
44template<>
45struct default_constructible_tuple_cons<tuples::null_type>:tuples::null_type
46{
47  default_constructible_tuple_cons(){}
48  default_constructible_tuple_cons(const tuples::null_type&){}
49};
50
51} /* namespace multi_index::detail */
52
53} /* namespace multi_index */
54
55} /* namespace boost */
56
57#endif /* BOOST_MSVC */
58
59#endif
Note: See TracBrowser for help on using the repository browser.