Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
My Type - nicro
//My type nicro #include <iostream> #include <string> using namespace std; template<class T>class nicro{ public: nicro(){} nicro(const nicro& n): val(n.val){} nicro(const T& t) : val(t){} ~nicro(){} nicro& operator =(const nicro& other){ val = other.val; return *this; } int operator <(const nicro& other)const{ return val < other.val; } int operator ==(const nicro& other)const{ return val == other.val; } friend ostream& operator <<(ostream& out, const nicro& n){ out << n.val; return out; } private: T val; }; typedef nicro<double>dNicro; typedef nicro<int>iNicro; void nicro_func(){ dNicro dn1; dNicro dn2(40.25); dNicro dn3(dn2); dNicro dn4(255); dNicro dn5(2*8); iNicro in1(4095); iNicro in2; iNicro in3(in1); iNicro in4(65); dn1 = dn4; cout << "\ndn2 = " << dn2; cout << "\ndn3 = " << dn3; cout << "\ndn1 = " << dn1; cout << "\ndn4 = " << dn4; cout << "\ndn5 = " << dn5; cout << "\n"; cout << "\nin1 = " << in1; cout << "\nin3 = " << in3; in2 = in4; cout << "\nin4 = " << in4; cout << "\nin2 = " << in2; }; int main() { nicro_func(); return 0; }
run
|
edit
|
history
|
help
0
C++
Median of row wise sorted matrix
char pointer in class
segmentedSieveR
HeapDoubLinArr
OTHER - Two robots
MovConstrAssign2
Peg Grammar Parser Grasshopper Language
Size of data type test
PreDir