MCPcopy Create free account
hub / github.com/andreasfertig/cppinsights / first_plus_last

Function first_plus_last

tests/p2662Test.cpp:4–7  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3template<typename... T>
4constexpr auto first_plus_last(T... values) -> T...[0]
5{
6 return T...[0](values...[0] + values...[sizeof...(values) - 1]);
7}
8
9// first_plus_last(); // ill formed
10static_assert(first_plus_last(1, 2, 10) == 11);

Callers 1

p2662Test.cppFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected