From 4d823595fed8c28a4b4c8d7975795ef7f6013c89 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Fri, 5 Apr 2024 01:36:09 -0400 Subject: [PATCH] xo-unit: ex1: + static assert --- example/ex1/ex1.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/example/ex1/ex1.cpp b/example/ex1/ex1.cpp index 2e286e7c..8909e188 100644 --- a/example/ex1/ex1.cpp +++ b/example/ex1/ex1.cpp @@ -5,13 +5,17 @@ int main () { + namespace u = xo::unit::units; namespace qty = xo::unit::qty; + using xo::unit::quantity; using namespace std; auto t = qty::milliseconds(10); auto m = qty::kilograms(2.5); auto a = m / (t*t); + static_assert(same_as>); + cerr << "t: " << t << ", m: " << m << ", m.t^-2: " << a << endl; }