Line |
Branch |
Exec |
Source |
1 |
|
|
// |
2 |
|
|
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com) |
3 |
|
|
// |
4 |
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying |
5 |
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
6 |
|
|
// |
7 |
|
|
// Official repository: https://github.com/CPPAlliance/http_proto |
8 |
|
|
// |
9 |
|
|
|
10 |
|
|
#ifndef BOOST_HTTP_PROTO_DETAIL_TYPE_INDEX_HPP |
11 |
|
|
#define BOOST_HTTP_PROTO_DETAIL_TYPE_INDEX_HPP |
12 |
|
|
|
13 |
|
|
namespace boost { |
14 |
|
|
namespace http_proto { |
15 |
|
|
namespace detail { |
16 |
|
|
|
17 |
|
|
// like std::type_index, |
18 |
|
|
// but without requiring RTTI |
19 |
|
|
using type_index = void const*; |
20 |
|
|
|
21 |
|
|
// return type_index for T. |
22 |
|
|
// This might not be unique in |
23 |
|
|
// a shared-library scenario. |
24 |
|
|
template <class T> |
25 |
|
|
type_index |
26 |
|
7 |
get_type_index() noexcept |
27 |
|
|
{ |
28 |
|
|
static constexpr char c{}; |
29 |
|
7 |
return &c; |
30 |
|
|
} |
31 |
|
|
|
32 |
|
|
} // detail |
33 |
|
|
} // http_proto |
34 |
|
|
} // boost |
35 |
|
|
|
36 |
|
|
#endif |
37 |
|
|
|