userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
boost_optional.hpp
Go to the documentation of this file.
1
#pragma once
2
6
7
#include <boost/optional.hpp>
8
9
#include <
userver/formats/common/type.hpp
>
10
#include <
userver/formats/serialize/to.hpp
>
11
12
USERVER_NAMESPACE_BEGIN
13
15
namespace
formats::serialize
{
16
17
template
<
typename
T,
typename
Value>
18
Value Serialize(
const
boost::optional<T>& value,
To<Value>
) {
19
if
(!value) {
20
return
{};
21
}
22
23
return
typename
Value::Builder(*value).ExtractValue();
24
}
25
26
}
// namespace formats::serialize
27
28
USERVER_NAMESPACE_END
userver
formats
serialize
boost_optional.hpp
Generated on
for userver by
Doxygen
1.17.0