Skip to content

type_template dimension_list

kwikius edited this page Aug 2, 2020 · 27 revisions

| Home | Concepts | Types |

Signature

pqs::dimension_list<base_quantity_exponent...>

Header file

#include <pqs/concepts/associated/dimension_list.hpp

Description

A list of base_quantity_exponents representing a dimension.

Example
   auto constexpr acc = abstract_length_v / pow<2>(abstract_time_v) ;

   static_assert( dimension<decltype(acc)>);
   static_assert( is_simple_dimension_list<decltype(acc)>);

   // convert to fixed_string in the S.I. system using utf8 encoding
   auto constexpr acc_str_si = 
      dimension_to_fixed_string<
         si_measurement_system,charset_utf8
      >(acc);

   // convert to fixed_string in fps system
   auto constexpr acc_str_fps = 
      dimension_to_fixed_string<
         imperial_measurement_system,charset_utf8
      >(acc);

   std::cout << "acc_v1 dimension in S.I. = " << acc_str_si <<'\n';
   std::cout << "acc_v1 dimension in f.p.s = " << acc_str_fps <<'\n';

   auto constexpr acc_v2 = abstract_length_v * pow<-2>(abstract_time_v); // alternate form

   static_assert( acc_v2 == acc ); 

example output : acc_v1 dimension in S.I. = m⋅s⁻²
                 acc_v1 dimension in f.p.s = ƒƫ⋅s⁻²

Notes

  • A single element dimension_list is replaced by its element.
  • A zero element dimension_list is replaced by dimensionless.

Notation

typename type notes
Dlist dimension_list< base_quantity_exponent...>

Provides

concept notes
dimension< Dlist >

TODO

type list functionality

Clone this wiki locally