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

Method sum

tests/NonTypeTemplateParameterPackTest.cpp:5–11  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3public:
4 template <int N, int ... Rest>
5 int sum(){
6 if constexpr(sizeof...(Rest) > 0) {
7 return N + sum<Rest...>();
8 } else {
9 return N;
10 }
11 }
12
13
14 template<typename I, typename ... Rest>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected