morzhovets/momo

std::exception: Cannot create DataColumnList

asidorov95 opened this issue · 1 comments

#include <iostream>
#include "momo/DataTable.h"

namespace a {
	MOMO_DATA_COLUMN_STRING(int, v);
	// MOMO_DATA_COLUMN_STRING(int, v);  //error: redefinition of 'v'
}

namespace b {
	MOMO_DATA_COLUMN_STRING(int, v);
}

int main() try
{
	momo::experimental::DataColumnList<> {a::v, b::v};
	return 0;
}
catch (std::exception &ex)
{
	std::cerr << "std::exception: " << ex.what() << std::endl;
}

Starting from v3.9 you can write this way

namespace a {
	/*inline*/ constexpr momo::DataColumn<int> v("a::v");
}
namespace b {
	/*inline*/ constexpr momo::DataColumn<int> v("b::v");
}

int main()
{
	momo::DataColumnList<> columns{ a::v, b::v };
	momo::DataTable<> table({ a::v, b::v });
	return 0;
}