11#include <fmt/compile.h>
12#include <fmt/format.h>
14USERVER_NAMESPACE_BEGIN
20std::string
ToString(
const std::optional<T>& from) {
21 return from ? fmt::format(FMT_COMPILE(
" {}"), *from) :
"--";
25template <
typename T,
typename Func>
26auto OptionalTransform(T&& opt, Func func) -> std::optional<
decltype(std::move(func)(*std::forward<T>(opt)))> {
27 if (opt)
return std::move(func)(*std::forward<T>(opt));