Questions tagged [boost-units]

67 questions
0
votes
0 answers

Boost.Units and assignment operator with prefixes

I am trying to get started with Boost.Units and facing the following issue: #include #include #include using namespace boost::units::si; using…
matpen
  • 281
  • 2
  • 15
0
votes
1 answer

How to pass a Boost unit as a method parameter

I am trying to use Boost.Units in my project. I mostly have it working, but I would like to have an accessor method that will allow me to get the raw value using different scaling values. For example, I would like to get a value in volts one time,…
dcofer
  • 303
  • 2
  • 10
0
votes
1 answer

Boost.Units frequency to period

I am trying to use the Boost.Units library in my conversion of a frequency (for instance, 20kHz) into the duration of its period (50000 nanoseconds). I don't want to use floating point. The trouble I am having is that simply taking the reciprocal…
user1714423
  • 191
  • 5
0
votes
2 answers

Adding only boost::units to a C++ project

I have an open-source thermodynamic property library that is coded all in C++ and I am finally getting frustrated with dealing with units. I would like therefore to add boost::units to my core code in order to use boost::units to do all the unit…
ibell
  • 1,070
  • 8
  • 29
0
votes
1 answer

Using printf with boost::units::quantity values

The boost::units library provides a nice way to write quantity values to a stream, see for example. Can I use printf with the quantity values instead of using the output stream? I have a fair amount of code which has formatted the output nicely…
ccook
  • 5,869
  • 6
  • 56
  • 81
0
votes
1 answer

Are bidirectional conversions by design or a bug?

#include #include #include using namespace boost::units; struct bu1 : base_unit {}; struct bu2 : base_unit
Arlen
  • 6,641
  • 4
  • 29
  • 61
-1
votes
1 answer

using boost::units to calculate geo coordinates

I'm trying to do a type-safe C++ implementation of the formula from [Calculate distance, bearing and more between Latitude/Longitude points][1]. Unfortunately I'm running into C++ type errors that bury the actual problem under endless template…
jpo234
  • 419
  • 3
  • 9
1 2 3 4
5