MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1xxfw9i/cppanditsvectorbooleans/19sphorcgx9yb/?context=3
r/ProgrammerHumor • u/Recent-Analysis-6880 • 16d ago
214 comments sorted by
View all comments
Show parent comment
6
template <typename T>
class CoolerVector : public std::vector<T> { using std::vector<T>::vector; };
template <>
class CoolerVector<bool> : public std::vector<uint8_t> { using std::vector<uint8_t>::vector; };
1 u/dedservice 11d ago Yeah I know there are workarounds but there just shouldn't have to be.
1
Yeah I know there are workarounds but there just shouldn't have to be.
View all comments
Show parent comment
6
u/That-Cpp-Girl 16d ago
template <typename T>
class CoolerVector : public std::vector<T> { using std::vector<T>::vector; };
template <>
class CoolerVector<bool> : public std::vector<uint8_t> { using std::vector<uint8_t>::vector; };