RESTinio
variant.hpp
Go to the documentation of this file.
1 /*
2  restinio
3 */
4 
5 /*!
6  Adoption for std::variant (c++17).
7 
8  @since v.0.4.8
9 */
10 
11 #pragma once
12 
13 #if defined(RESTINIO_EXTERNAL_VARIANT_LITE)
14  #include <nonstd/variant.hpp>
15 #else
16  #include "third_party/variant-lite/variant.hpp"
17 #endif
18 
19 namespace restinio
20 {
21  template< typename... Types >
22  using variant_t = nonstd::variant< Types... >;
23 
24  using nonstd::holds_alternative;
25  using nonstd::get;
26  using nonstd::get_if;
27  using nonstd::visit;
28 
29 } /* namespace restinio */
typedef variant_ALIGN_AS(max_type) align_as_type
std::enable_if< std::is_same< Parameter_Container, query_string_params_t >::value||std::is_same< Parameter_Container, router::route_params_t >::value, optional_t< Value_Type > >::type opt_value(const Parameter_Container &params, string_view_t key)
Gets the value of a parameter specified by key wrapped in optional_t<Value_Type> if parameter exists ...
Definition: value_or.hpp:64