1#ifndef SCIFIR_UNITS_MECA_NUMBER_LAB_NUMBER_HPP_INCLUDED
2#define SCIFIR_UNITS_MECA_NUMBER_LAB_NUMBER_HPP_INCLUDED
4#include "../util/is_number.hpp"
5#include "../util/types.hpp"
6#include "../units/scalar_unit.hpp"
8#include "boost/algorithm/string.hpp"
41 if (values.size() == 3)
43 boost::trim(values[0]);
44 boost::trim(values[2]);
59 value = std::move(x.value);
122template<
typename T,
typename U>
125 if (x.value == y.value and x.error_value == y.error_value)
135template<
typename T,
typename U>
151 return !(x == init_lab_number);
164 return !(init_lab_number == x);
176 return x + to_string(y);
182 return to_string(x) + y;
188 return os << to_string(x);
lab_number< scalar_unit > operator+(const lab_number< U > &x) const
void operator-=(const lab_number< U > &x)
lab_number(const scalar_unit &x, const scalar_unit &y)
lab_number(const string &x, const string &y)
lab_number(const lab_number< T > &x)
lab_number< T > & operator=(const lab_number< T > &x)
string display(int number_of_decimals=2) const
lab_number< scalar_unit > operator/(const lab_number< U > &x) const
lab_number< scalar_unit > operator-(const lab_number< U > &x) const
lab_number(lab_number< T > &&x)
lab_number(const string &init_lab_number)
void operator+=(const lab_number< U > &x)
lab_number< scalar_unit > operator*(const lab_number< U > &x) const
Class that allows to create scalar units, which are composed of a value (as a float) and dimensions....
void operator+=(string &x, const scifir::lab_number< T > &y)
bool operator==(const scifir::lab_number< T > &x, const scifir::lab_number< U > &y)
istream & operator>>(istream &is, scifir::lab_number< T > &x)
string operator+(const string &x, const scifir::lab_number< T > &y)
ostream & operator<<(ostream &os, const scifir::lab_number< T > &x)
bool operator!=(const scifir::lab_number< T > &x, const scifir::lab_number< U > &y)
The namespace scifir contains all scifir-units, excepting the string literals, which are outside.
string to_string(const aid &x)
Creates a string representation of aid, it's for aid equivalent to the display() function of aid.
bool is_lab_number(const string &init_lab_number)