resolve template specialization with inline keyword

This commit is contained in:
hugogogo
2022-06-18 17:58:14 +02:00
parent 72762a79cb
commit 94745ca8a9
11 changed files with 222 additions and 327 deletions

View File

@@ -0,0 +1,54 @@
#include "tests_utils.hpp"
// functions
// **********************************************
void add_to_list(std::string s, A_test* s1, A_test* s2, A_test* s3, A_test* s4) {
std::vector<A_test*> test_sub_list;
s1->title = s;
s2->title = s;
s3->title = s;
s4->title = s;
s1->type = "int";
s2->type = "char";
s3->type = "std::string";
s4->type = "mystruct";
test_sub_list.push_back(s1);
test_sub_list.push_back(s2);
test_sub_list.push_back(s3);
test_sub_list.push_back(s4);
test_list.push_back(test_sub_list);
}
void delete_structs() {
std::vector<mystruct*>::iterator it;
std::vector<mystruct*>::iterator it_end = mem_list.end();
for (it = mem_list.begin(); it != it_end; ++it)
delete *it;
mem_list.clear();
}
// mystruct
// ***********************************************
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);
}