rippled
LowestLayer.h
1 
2 //------------------------------------------------------------------------------
3 /*
4  This file is part of rippled: https://github.com/ripple/rippled
5  Copyright (c) 2019 Ripple Labs Inc.
6 
7  Permission to use, copy, modify, and/or distribute this software for any
8  purpose with or without fee is hereby granted, provided that the above
9  copyright notice and this permission notice appear in all copies.
10 
11  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 */
19 //==============================================================================
20 
21 #ifndef RIPPLE_SERVER_LOWESTLAYER_H_INCLUDED
22 #define RIPPLE_SERVER_LOWESTLAYER_H_INCLUDED
23 
24 #if BOOST_VERSION >= 107000
25 #include <boost/beast/core/stream_traits.hpp>
26 #else
27 #include <boost/beast/core/type_traits.hpp>
28 #endif
29 
30 namespace ripple {
31 
32 // Before boost 1.70, get_lowest_layer required an explicit templat parameter
33 template <class T>
34 decltype(auto)
35 get_lowest_layer(T& t) noexcept
36 {
37 #if BOOST_VERSION >= 107000
38  return boost::beast::get_lowest_layer(t);
39 #else
40  return t.lowest_layer();
41 #endif
42 }
43 
44 } // namespace ripple
45 
46 #endif
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
ripple::get_lowest_layer
decltype(auto) get_lowest_layer(T &t) noexcept
Definition: LowestLayer.h:35