See:
|
grid( DataSet1&& ds1, DataSet2&& ds2 ) |
Which boils down to
template<typename DataSet1, typename DataSet2>
class grid {
//! Constructor
grid( DataSet1&& ds1, DataSet2&& ds2 )
: m_ds1( std::forward<DataSet1>( ds1 ) )
, m_ds2( std::forward<DataSet2>( ds2 ) )
{}
};
Here DataSet1 and DataSet2, while template parameters to the class, are not template parameters to the function.
As a result, this formulation of the constructor always takes these two parameters as rvalue-reference.
This can be corrected in 3 ways
- Take both parameters by value
- Make the constructor a template function
- Make additional constructors that represent the cross-product of const& and && for each parameter. In this case, resulting in 4 functions.
I see that this same mistake is done in more than one place, it's not only grid.hpp where it happens.
See:
test/include/boost/test/data/monomorphic/grid.hpp
Line 96 in 11a8d37
Which boils down to
Here
DataSet1andDataSet2, while template parameters to the class, are not template parameters to the function.As a result, this formulation of the constructor always takes these two parameters as rvalue-reference.
This can be corrected in 3 ways
I see that this same mistake is done in more than one place, it's not only grid.hpp where it happens.