MCPcopy Create free account
hub / github.com/boost-ext/ut / main

Function main

example/sl.cpp:10–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8#include <boost/ut.hpp>
9
10int main() {
11 using namespace boost::ut;
12
13#if defined(_MSC_VER) and not defined(__clang__)
14 // MSVC fails if the `""_i` literal operator is used inside the 'verify' lambda:
15 // "sl.cpp(16,37): error C3688: invalid literal suffix '_i'; literal operator or literal operator template 'operator ""_i' not found"
16 "sl"_test = [] {
17 static constexpr auto _42_i = 42_i;
18 auto verify = [](auto sl, auto i) {
19 expect(i == _42_i, sl) << "error with given source location";
20 };
21
22 verify(boost::ut::reflection::source_location::current(), 42_i);
23 };
24#else
25 "sl"_test = [] {
26 auto verify = [](auto sl, auto i) {
27 expect(i == 42_i, sl) << "error with given source location";
28 };
29
30 verify(boost::ut::reflection::source_location::current(), 42_i);
31 };
32#endif
33}

Callers

nothing calls this directly

Calls 1

expectFunction · 0.85

Tested by

no test coverage detected