Skip to content

Commit f387d70

Browse files
author
pierreblavy
committed
Synchronization with the main project. To get changelog and doc please visit https://tentacule.be/fossil/cpp-msmodels
1 parent d53bee8 commit f387d70

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Quantity.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,5 +341,17 @@ std::ostream & operator<<(std::ostream & out, const unit_lite::Quantity<T,U> &q)
341341

342342

343343

344+
//to string
345+
namespace std{
346+
template<typename T, typename U>
347+
std::string to_string(const ::unit_lite::Quantity<T,U> &q){
348+
typedef unit_lite::Quantity<T,U> quantity_t;
349+
std::string r = std::to_string(q.value);
350+
r += " ";
351+
r += unit_lite::print_compose_unit<typename quantity_t::unit_t>::str();
352+
return r;
353+
}
354+
}
355+
344356

345357
#endif /* SRC_LIB_UNIT_LITE_QUANTITY_HPP_ */

unit_lite.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ typedef std::remove_const<decltype(ME)>::type ME##_quantity;\
115115

116116

117117

118-
119118
namespace unit_lite{
120119
template<typename Tag_t> struct print_tag;
121120
}
@@ -530,13 +529,4 @@ auto pow(const unit_lite::Quantity<U1,V1> &t){
530529

531530

532531

533-
534-
535-
536-
537-
538-
539-
540-
541-
542532
#endif /* SRC_LIB_UNIT_LITE_UNIT_LITE_HPP_ */

0 commit comments

Comments
 (0)