similar
. You
have the option of using the similarTo
member function,
which does allow a default tolerance.
Unit3D< Length > length(MetersLength(5),
MetersLength(7),
MetersLength(9));
// Compute velocity.
Unit3D< Speed > velocity = length / SecondsTime(2);
Instead, you must compute the individual components:
// Compute velocity.
Unit3D< Speed > velocity(length.x() / SecondsTime(2),
length.y() / SecondsTime(2),
length.z() / SecondsTime(2));
similar
. You
have the option of using the similarTo
member function,
which does allow a default tolerance.
Unit3D< Speed > speed(KnotsSpeed(200), KnotsSpeed(-200), KnotsSpeed(4));
cout << Speed3DFormat< KnotsSpeed >(speed) << endl; // error
For now, you must do the formatting yourself:
cout << '(' << (double)KnotsSpeed(speed.x())
<< ", " << (double)KnotsSpeed(speed.y())
<< ", " << (double)KnotsSpeed(speed.z())
<< ") " << KnotsSpeed::unitsString << endl;