Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6634775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:58:09+00:00 2026-05-25T22:58:09+00:00

I am currently using boost::units to represent torque in si units, however I am

  • 0

I am currently using boost::units to represent torque in si units, however I am given the torque in pound feet. I am attempting thus to create a pound_foot unit of torque and a conversion to support this. My lazy attempt was to simply define:

BOOST_STATIC_CONST(boost::si::torque, pound_feet = 1.3558179483314 * si::newton_meters);

And then do:

boost::si::torque torque = some_value * pound_feet;

But this feels unsatisfactory. My second attempt was to attempt to define a new base unit called a pound_foot (see below). But when I attempt to use it in a way similar to the above (with a cast to the si unit) I get a page full of errors. Any suggestions on the correct approach?

namespace us {
  struct pound_foot_base_unit : base_unit<pound_foot_base_unit, torque_dimension> { };
    typedef units::make_system<
            pound_foot_base_unit>::type us_system;
    typedef unit<torque_dimension, us_system> torque;
    BOOST_UNITS_STATIC_CONSTANT(pound_foot, torque);
    BOOST_UNITS_STATIC_CONSTANT(pound_feet, torque);        
}
BOOST_UNITS_DEFINE_CONVERSION_FACTOR(us::torque, 
                                     boost::units::si::torque, 
                                     double, 1.3558179483314);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T22:58:10+00:00Added an answer on May 25, 2026 at 10:58 pm

    Pound foot isn’t really a base unit, so better go with the clean way and define it in terms of the base units, which are feet and pounds:

    #include <boost/units/base_units/us/pound_force.hpp>
    #include <boost/units/base_units/us/foot.hpp>
    #include <boost/units/systems/si/torque.hpp>
    #include <boost/units/quantity.hpp>
    #include <boost/units/io.hpp>
    #include <iostream>
    
    namespace boost {
    namespace units {
    namespace us {
    
    typedef make_system< foot_base_unit, pound_force_base_unit >::type system;
    typedef unit< torque_dimension, system > torque;
    
    BOOST_UNITS_STATIC_CONSTANT(pound_feet,torque);
    
    }
    }
    }
    
    using namespace boost::units;
    
    int main() {
        quantity< us::torque > colonial_measurement( 1.0 * us::pound_feet );
        std::cerr << quantity< si::torque >(colonial_measurement) << std::endl;
        return 0;
    }
    

    This program computes the conversion factor from the known values of foot and pound, the output is 1.35582 m^2 kg s^-2 rad^-1. Please allow me nonetheless to sneer at the inferiority of the imperial system.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Boost.Test for Unit testing and am currently running various mock servers in
I'm currently using Boost's multi-index to help keep track of how many times a
How would I do case insensitive string comparison using boost locale? Currently I do
I'm currently using the boost threadpool with the number of threads equal to the
I'm currently struggling with a basic socket problem using boost::asio. A server is sending
I'm working on a multithreaded server in c++ using boost-asio. Currently a design problem
I am trying to do unit testing (using the Boost unit testing framework) on
I'm using boost to create a directory to place some temp files in. int
I currently use C++ to do some graph related computation using boost::graph. boost::graph can
I'm currently using boost::intrusive_ptr together with my GUI classes. Although this is more or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.