MCPcopy Create free account
hub / github.com/Apress/beginning-cpp20 / my_size

Function my_size

Exercises/NoModules/Chapter 10/Soln10_04.cpp:10–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8// Look ma, no sizeof()!
9template <typename T, size_t N>
10size_t my_size(const T (&array)[N]) { return N; }
11
12// Overload with two other templates for std::vector<> and array<>
13template <typename T>

Callers 1

mainFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected