Code Monkey home page Code Monkey logo

strong_typedef's People

Contributors

anthonywilliams avatar legalizeadulthood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

strong_typedef's Issues

Make this a standard library proposal

I watched your CppNow presentation and I really like this approach to strong typedefs.

Have you thought about making this a standard library proposal for C++23?

I know that's a lot of work, but I'd be willing to collaborate to make it happen. I'm familiar with LaTeX (see my book here), so that's not a problem for me.

Missing operators: bitwise, unary, multiplicative, op=

I didn't spot the following operators:

  • bitwise: ~ & ¦ ^ << >>
  • multiplicative: * / %
  • unary+, unary-
  • op= counterparts

Are these yet to be added?
Does op= fit in this approach? If not, what about "do as the ints do"?

Use of deprecated C++ features

Hi - this is pretty cool! But it uses std::is_literal_type, which is deprecated in C++17 and removed in C++20 - which makes this unusable in the majority of codebases I would assume. Any plan to address this?

Suggestion: Dependent index and diff/size types

A fairly common usage when dealing with arrays, is to have an index (or pointer) type, and another type being a difference between indices (or sometimes an unsigned size).

It would be great if I could define two strong types for these (let's call them I and D), such that:

  • I - I -> D
  • I + D -> I
  • I - D -> I
  • D + D -> D
  • D - D -> D
  • I comp I -> bool
  • D comp D -> bool
  • Maybe D * integral -> D? D / integral? D / D?
    All other operations would be forbidden.

C++11 compatibility?

Thank you for this library, which looks very interesting! I am working in C++11 at the moment and am not able to compile the test program (log attached). Would you be willing to make C++11 compatibility an option? Thank you for considering this request!

The log is for g++ -std=c++11 -g -o test_strong_typedef test_strong_typedef.cpp on gcc 9.3.0 x64.
c++11.log

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.