Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
#include <iostream>
static inline void foo(short s) {
std::cout << s << std::endl;
}
auto main() -> int {
foo(limit_cast<short>(123));
if(auto converted = convert_if_fits<short>(12345)) {
std::cout <<
extract(converted) << std::endl;
}
if(auto converted = convert_if_fits<short>(123456)) {
std::cout <<
extract(converted) << std::endl;
} else {
std::cout << "value too big" << std::endl;
}
return 0;
}
static constexpr auto extract(api_result_value< Result, api_result_validity::never > &) noexcept -> Result &
Overload of extract for api_result_value.
Definition: c_api_wrap.hpp:270