[why]
We backported is_invocable<> but there you have to write
is_invocable<>::value all the time.
Same with is_invocable_r<>.
C++17 in fact also has the helper templates with the _v suffix.
[how]
Just add the helper template, but leave out the inline part.
That can result in multiple identical symbols in the resulting
executable, but apart from the space issue this is 100% safe.
The duplication is from the symbol name and a small bit of the data
itself (a boolean). Duplication happens once for each TU the template is
used in with a specific signature.
[why] We backported
is_invocable<>
but there you have to writeis_invocable<>::value
all the time.Same with
is_invocable_r<>
.C++17 in fact also has the helper templates with the
_v
suffix.[how] Just add the helper template, but leave out the
inline
part. That can result in multiple identical symbols in the resulting executable, but apart from the space issue this is 100% safe.The duplication is from the symbol name and a small bit of the data itself (a boolean). Duplication happens once for each TU the template is used in with a specific signature.
Here an example when we use the same
in two TUs (i.e. two
test_*.cc
files):