1
2// Copyright (C) 2008-2016 Daniel James.
3// Distributed under the Boost Software License, Version 1.0. (See accompanying
4// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
6#ifndef BOOST_UNORDERED_FWD_HPP_INCLUDED
7#define BOOST_UNORDERED_FWD_HPP_INCLUDED
8
9#include <boost/config.hpp>
10#if defined(BOOST_HAS_PRAGMA_ONCE)
11#pragma once
12#endif
13
14#include <boost/predef.h>
15
16#if defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
17// Already defined.
18#elif defined(BOOST_LIBSTDCXX11)
19// https://github.com/gcc-mirror/gcc/blob/gcc-4_6-branch/libstdc++-v3/include/bits/stl_pair.h#L70
20#if BOOST_LIBSTDCXX_VERSION > 40600
21#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
22#endif
23#elif BOOST_LIB_STD_CXX
24// https://github.com/llvm-mirror/libcxx/blob/release_30/include/utility#L206
25#if BOOST_LIB_STD_CXX >= BOOST_VERSION_NUMBER(3, 0, 0)
26#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
27#endif
28#elif defined(BOOST_LIB_STD_DINKUMWARE)
29// Apparently C++11 standard supported in Visual Studio 2012
30// https://msdn.microsoft.com/en-us/library/hh567368.aspx#stl
31// 2012 = VC+11 = BOOST_MSVC 1700 Hopefully!
32// I have no idea when Dinkumware added it, probably a lot
33// earlier than this check.
34#if BOOST_LIB_STD_DINKUMWARE >= BOOST_VERSION_NUMBER(6, 50, 0) || \
35 BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(17, 0, 0)
36#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 1
37#endif
38#endif
39
40// Assume that an unknown library does not support piecewise construction.
41#if !defined(BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT)
42#define BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT 0
43#endif
44
45#if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
46#include <utility>
47#endif
48
49namespace boost {
50 namespace unordered {
51#if BOOST_UNORDERED_HAVE_PIECEWISE_CONSTRUCT
52 using std::piecewise_construct_t;
53 using std::piecewise_construct;
54#else
55 struct piecewise_construct_t
56 {
57 };
58 const piecewise_construct_t piecewise_construct = piecewise_construct_t();
59#endif
60 }
61}
62
63#endif
64

source code of include/boost/unordered/detail/fwd.hpp