I have a unit class that has properties
std::is_trivial<unit>::value; // true std::is_trivially_copyable<unit>::value; // true (on compilers which have this trait)
I would like to pass unit vectors as a tuple, for example
using geodeticTuple = std::tuple<unit, unit, unit>;
I need these vectors to go into conversion functions that use different types of arguments, for example.
someOtherType convert(const geodeticTuple& point, const geodeticTuple& origin) or
someOtherType convert(const geodeticTuple& point, ...)
using MSVC2015, this works fine, but with gcc-4.9.3 I get an error:
error: cannot pass objects with a nontrivially copied type const geodeticTuple {aka const struct std::tuple<unit, unit, unit>} via ...
and since gcc-4.9.3 does not support styles like is_trivially_xxx style, I am having trouble understanding why this is happening.
Is a tuple of trivial types that cannot be trivially copied?
c ++ c ++ 11 tuples typetraits stdtuple
Nicolas holthaus
source share