Suppose I have a simple class:
class Pvector
{
private:
std::vector<long double> point_list;
public:
Pvector(std::initializer_list<long double> coords) : point_list(coords)
{}
Pvector(std::initializer_list<int> coords) : point_list(coords)
{}
};
This will not compile because the std::vectortemplated on type template long doublecannot be initialized from an initialization list configured by type int. This is rather inconvenient, however, since when removing the second constructor, I cannot do the following in my code:
Pvector piece_movement({E.X - S.X, E.Y - S.Y, E.Z - S.Z});
, int. , , . Pvector, , point_list long double (- ) , . ?