mirror of
https://github.com/mpusz/mp-units.git
synced 2026-05-05 12:24:15 +02:00
refactor: op[U] for quantity and quantity_point replaced with .in(U)
Resolves #469
This commit is contained in:
@@ -31,17 +31,14 @@
|
||||
#include <cmath>
|
||||
#include <matrix>
|
||||
|
||||
|
||||
template<typename Rep = double>
|
||||
using vector = STD_LA::fixed_size_column_vector<Rep, 3>;
|
||||
|
||||
template<typename Rep>
|
||||
inline constexpr bool mp_units::is_vector<vector<Rep>> = true;
|
||||
|
||||
namespace STD_LA {
|
||||
|
||||
template<typename Rep>
|
||||
std::ostream& operator<<(std::ostream& os, const ::vector<Rep>& v)
|
||||
std::ostream& operator<<(std::ostream& os, const vector<Rep>& v)
|
||||
{
|
||||
os << "|";
|
||||
for (auto i = 0U; i < v.size(); ++i) {
|
||||
@@ -51,8 +48,6 @@ std::ostream& operator<<(std::ostream& os, const ::vector<Rep>& v)
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace STD_LA
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace mp_units;
|
||||
@@ -88,7 +83,7 @@ TEST_CASE("vector quantity", "[la]")
|
||||
SECTION("non-truncating")
|
||||
{
|
||||
const auto v = vector<int>{3, 2, 1} * isq::position_vector[km];
|
||||
CHECK(v[m].number() == vector<int>{3000, 2000, 1000});
|
||||
CHECK(v.in(m).number() == vector<int>{3000, 2000, 1000});
|
||||
}
|
||||
|
||||
SECTION("truncating")
|
||||
|
||||
Reference in New Issue
Block a user