Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Class operator overloading the subscript and boundary check for array
//clang 3.8.0 #include <cassert> #include <iostream> class IntList{ private: int m_intList[10]; public: int& operator[](const int); }; int& IntList::operator[](const int index){ assert(index>=0&&index<10); return m_intList[index]; } int main() { IntList list; list[4]=7;; std::cout << list[4]; }
run
|
edit
|
history
|
help
0
boost::geometry::distance performance overhead compared to a straightforward implementation
wellformed number
Test bitfields with unnamed union
hello,world !ssn2019
applidiumResto_NicolasCarre
BucketSort
std::function ambiguity clang
Sum of Natural Numbers using loop
numeric_limits
Linker error while passing constexpr variable as const &