MCPcopy Create free account
hub / github.com/davisking/dlib / try_set_i

Function try_set_i

dlib/test/constexpr_if.cpp:167–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165
166 template<typename T>
167 bool try_set_i(T& obj, int i)
168 {
169 return switch_(bools(is_detected<set_i_pred, T>{}),
170 [&](true_t, auto _) {
171 _(obj).set_i(i);
172 return true;
173 },
174 [](auto...){
175 return false;
176 }
177 );
178 }
179
180 void test_set_i()
181 {

Callers 1

test_set_iFunction · 0.85

Calls 4

switch_Function · 0.85
_Function · 0.85
set_iMethod · 0.80
boolsClass · 0.50

Tested by

no test coverage detected