-
-
Save Borgleader/759e6b92ffb1d84ffaa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No errors | |
template <typename Container> | |
std::size_t size_in_bytes(Container& c) | |
{ | |
return c.size() * sizeof(typename Container::value_type); | |
} | |
//Error C2065 'value_type': undeclared identifier | |
//Error C2825 'Container': must be a class or namespace when followed by '::' | |
//Error C2510 'Container': left of '::' must be a class/struct/union | |
template <typename Container> | |
std::size_t size_in_bytes(Container&& c) | |
{ | |
return c.size() * sizeof(typename Container::value_type); // <-- from this line (obv) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment