resolve template specialization with inline keyword
This commit is contained in:
19
tests/tests_mystruct.cpp
Normal file
19
tests/tests_mystruct.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
#include "tests_mystruct.hpp"
|
||||
|
||||
mystruct::mystruct(int data)
|
||||
{_val = new int[2]; _val[0] = data; _val[1] = data;}
|
||||
|
||||
mystruct::~mystruct()
|
||||
{delete[] _val;}
|
||||
|
||||
int * mystruct::get_data() const
|
||||
{return _val;}
|
||||
|
||||
std::ostream & operator<<(std::ostream & o, mystruct const * rhs) {
|
||||
if (rhs != NULL)
|
||||
o << (*rhs).get_data()[0] << "," << (*rhs).get_data()[1];
|
||||
else
|
||||
o << "NULL";
|
||||
return (o);
|
||||
}
|
||||
Reference in New Issue
Block a user