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

  • SEARCH
  • Home
  • 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 8818757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:11:08+00:00 2026-06-14T05:11:08+00:00

C++1x supports literal suffixes (cmp. e.g. http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11Style.pdf ). I am using gcc 4.7 and

  • 0

C++1x supports literal suffixes (cmp. e.g. http://ecn.channel9.msdn.com/events/GoingNative12/GN12Cpp11Style.pdf). I am using gcc 4.7 and want to introduce some units for our system. Most notably half of our code uses degrees and the other half radians (due to various 3rd party libraries), and obviously this is always a constant cause of mistakes. Being able to say e.g. “Radian angle = 90_deg;” would be so helpful.

I’ve looked into how to implement this and it looks doable, however it will take some time to get everything right. So I wonder whether there is a finished/tested implementation out there that already implements all this that can be used (no need for every C++ developer to re-implement that, is there?). Aside from rad/deg I am looking for length measurements (mm, cm, m). I’ve already googled but did not find anything usable.

Does anybody know an implementation of e.g. the SI system that can be used?

  • 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-06-14T05:11:10+00:00Added an answer on June 14, 2026 at 5:11 am

    Use boost.units.

    You will get the expected benefit: being able to safely deal with metrics expressed in different units.
    The syntax with boost units is not that bad:

    quantity<length>    dx(2.0*meter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Mysql supports prepared statements in this way: http://dev.mysql.com/doc/refman/5.0/en/sql-syntax-prepared-statements.html Is there a support for it
Asciidoc supports callouts . How can one write similar callouts using reStructuredText ?
hudson supports submitting a build by doing an HTTP GET to an API. I
I know that ActiveMQ supports the JMSXUserID property: http://activemq.apache.org/jmsxuserid.html I'm trying to use Apollo
I am using MVC3 and that i know MVC3 support binding JSON literal to
As I noticed on oracle.com that Java has no support for XML literal in
Spring supports programmatic transaction which give us fine grained control over TX management. According
ld supports a few options for specifying upward dependencies on OS X. What is
C++11 supports a new function syntax: auto func_name(int x, int y) -> int; Currently
Mercurial supports push-style cloning of repositories to remote hosts, however newly cloned repositories don't

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.