diff options
Diffstat (limited to 'cpp/030container')
-rw-r--r-- | cpp/030container | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cpp/030container b/cpp/030container index 0e013900..7f333509 100644 --- a/cpp/030container +++ b/cpp/030container @@ -51,6 +51,7 @@ recipe main [ :(before "End size_of(types) Cases") type_info t = Type[types[0]]; if (t.kind == container) { + // size of a container is the sum of the sizes of its elements size_t result = 0; for (size_t i = 0; i < t.elements.size(); ++i) { result += size_of(t.elements[i]); |