
Eisuke Kawashima: Thank You. I'll have a look. When I saw Boost.Units did not have imperial and we had to create it ourselves, I thought: the US is s 5 trillion dollar market, most of those markets need programming, all are on imperial. Boost.Units needs imperial and programmers would find and use it.
Steven Watanabe: Thank You.
This solution doesn't seem correct as it does not consider "length"....
boost::units::derived_dimension<
boost::units::mass_base_dimension, 1,
boost::units::time_base_dimension, -2>::typeI thought I'd at it (L M T^-2 L-1) but this didn't do well.: typedef boost::units::derived_dimension<
boost::units::length_base_dimension, 1,
boost::units::mass_base_dimension, 1,
boost::units::time_base_dimension, -2,
boost::units::length_base_dimension, -1
>::type
lineal_force_dimension;
So, I tried the " typedef boost::mpl::divides<...>" solution as it has force and length. I am closer, I hope.
*.h------------------------------------------------------------------------------------------------------------------------------------------
namespace dimensional_analysis {
typedef boost::units::length_base_dimension::dimension_type length_dimension;
typedef boost::units::mass_base_dimension::dimension_type mass_dimension;
typedef boost::units::make_system<
boost::units::us::inch_base_unit,
boost::units::us::pound_base_unit
>::type ip_system;
namespace lineal_force {
typedef boost::mpl::divides<
boost::units::force_dimension,
boost::units::length_dimension>::type
lineal_force_dimension;
namespace imperial {
typedef boost::units::unit<
lineal_force_dimension,
dimensional_analysis ::ip_system
> lineal_force_unit;
typedef boost::units::quantity
I am having trouble converting from one derived_dimension to another across systems (imperial to metric). I'd like to convert, say, lb/in to, say, kg/m. I thought I would do the following but get a compiler error #:
*.h-------------------------------------------------------------------------------- namespace dimensional_analysis { namespace lineal_force { //lb/in typedef boost::units::derived_dimension< boost::units::us::pound_force_base_unit, 1, boost::units::us::inch_base_unit, -1 >::type lb_per_inch_dimension; typedef boost::units::unit< lb_per_inch_dimension, dimensional_analysis::lengths::ip_system > lb_per_inch_unit; typedef boost::units::quantity
lb_per_inch_quantity; BOOST_UNITS_STATIC_CONSTANT(lbpin, lb_per_inch_quantity); //kg/m typedef boost::units::derived_dimension< boost::units::si::kilogram_base_unit, 1, boost::units::si::meter_base_unit, -1 >::type kg_per_meter_dimension; typedef boost::units::unit< kg_per_meter_dimension, boost::units::si::system > kg_per_meter_unit; typedef boost::units::quantity kg_per_meter_unit_quantity; BOOST_UNITS_STATIC_CONSTANT(kgpm, kg_per_meter_unit_quantity); }//lineal_force }//dimensional_analysis *.cp ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //Do I need these? BOOST_UNITS_DEFINE_CONVERSION_FACTOR(dimensional_analysis::lineal_force::kg_per_meter_unit, dimensional_analysis::lineal_force::lb_per_inch_unit, double, 0.0559974); // exact conversion BOOST_UNITS_DEFAULT_CONVERSION(dimensional_analysis::lineal_force::kg_per_meter_unit, dimensional_analysis::lineal_force::lb_per_inch_unit);
//This does not compile# const auto conv_factor_try0 = conversion_factor(dimensional_analysis::lineal_force::kg_per_meter_unit::unit_type(), dimensional_analysis::lineal_force::lb_per_inch_unit::unit_type());
# *\boost_1_68_0\boost\units\detail\conversion_impl.hpp(340): error C2672: 'conversion_factor': no matching overloaded function found (compiling source file...*.cpp)
Any help is appreciated
I opened a PR (https://github.com/boostorg/units/pull/32) to address
such a situation;
the following code
```cpp
#include <iostream>
#include
On Sun, 18 Nov 2018 at 05:31, Richard Z?vodn? via Boost-users
mailto:boost-users@lists.boost.org> wrote: ---------- Forwarded message --------- From: *Richard Z?vodn?*
mailto:zavodnyrichard@gmail.com> Date: Sat, Nov 17, 2018, 3:59 PM Subject: Boost::Filesystem - How to iterate, through the whole drive To: mailto:boost-users@lists.boost.org> Hey guys, I need iterate over all directories from starting path. If I start iterating from C:\some-dir it works very well, however if I try to iterate from C:\, it doesn't work. How can iterate through the whole drive? Thank you.
Code is here: https://pastebin.com/mpsKJxH2 https://pastebin.com/3J6FEMG5. The problem I experience is commented right in the code section (line 1, 13 and 25).
This works for me, either with boost-1.68 (not that I think that matters) or the STL-VC-15.9.1 (/std:c++17):
#include <iostream> #include
namespace fs = boost::filesystem;
int main ( ) { ??? for ( auto & p : fs::recursive_directory_iterator ( "d:\\" ) ) { ??????? std::cout << p.path ( ) << '\n'; ??? } }
Note that: "The iteration order is unspecified, except that each directory entry is visited only once."
degski -- /*/*?*/If something cannot go on forever, it will stop" - Herbert Stein*/