Code Monkey home page Code Monkey logo

Comments (8)

rollbear avatar rollbear commented on June 15, 2024 8

I think it's a good idea to split the type safe stuff from the vocabulary types. I also think it's a good idea to use the opportunity to make breaking changes, since you'll effectively introduce two new libraries that no one depends on.

I don't really have an opinion about boost.

from type_safe.

robertramey avatar robertramey commented on June 15, 2024

"Thank you all for making this my most popular project with tons of daily clones!"

Where do you get this statistic?

from type_safe.

neithernut avatar neithernut commented on June 15, 2024

Where do you get this statistic?

@robertramey the "Insights" tab of a repo contains a section "Traffic" which is only visible to the owner and maintainers.

from type_safe.

b-schoen avatar b-schoen commented on June 15, 2024

+1 for Boost! In larger projects it’s much easier to argue for strong types if there’s a small, convenient boost library for that purpose. IME the alternatives of writing + maintaining your own (or wrapping Boost Units + Boost Operators) are a much harder sell.

I think that given how many projects made use of @robertramey’s BOOST_STRONG_TYPEDEF, it seems like there’s probably a number of projects that would appreciate / use a small “strong typedef” library in boost.

@robertramey Has your thinking on the use for a “strong typedef” library in Boost changed since the conversation here?

from type_safe.

tavi-cacina avatar tavi-cacina commented on June 15, 2024

I don't think many people actually use the type safe building blocks other than the strong typedefs facility.

I wanted a std::variant to hold a mix of bool, const char*, intXX_t, float, double etc. enforcing the right type straight ahead. The default primitive types are bad for this because they convert too easy and you get the wrong type where you do not expect. Your type_safe variants for bool and numbers are quite handy to use instead.

If you just want improved integer types there are better and more advanced libraries.

Yeah, there you have a point, I just watched the presentation of safe_numerics from Robert Ramey(https://youtu.be/93Cjg42bGEw?t=2435). I'll have to check it out.

from type_safe.

rolandschulz avatar rolandschulz commented on June 15, 2024
  1. The strong typedefs library will be fully compatible, it is just the strong_typedefs.hpp header split into multiple files and with some more operations.

For integration a single header is nice. Would be nice to keep this at as an option.

from type_safe.

robertramey avatar robertramey commented on June 15, 2024

Has your thinking on the use for a “strong typedef” library in Boost changed since the conversation here?

No. I've had a lot of interest in the best way to use the C++ type system to enforce program correctness. I spent a fair amount of time on this and my efforts resulted in a talk for CPPCon on the subject (https://www.youtube.com/watch?v=632a-DMM5J0&t=1s). But I as not able to develop the facility that I originally hoped for - maybe some day. In the mean time I got enthralled in a related project - Safe Numerics (https://github.com/boostorg/safe_numerics) . This started out as simple idea but morphed into something much more elaborate and ambitious. It's been accepted into boost, I think it's very useful, but I'm still making some final enhancements.

I think there is some overlap with foonathan's library here. But I see them as quite different in scale, breadth and approach and can easily see where one would prefer on but not the other depending on the use case. I think this library would be a great addition to boost. I encourage you to fill out a page in the boost library incubator (www.blincubator.com) - my other quixotic quest - and post RFQ on the Boost Developer's mailing list. Also I think your library would be a good candidate for a conference (C++Now?) talk - if you haven't made one already.

from type_safe.

sgf avatar sgf commented on June 15, 2024

how about let it became a BCL(basic class library)
for example: integer
add type_safe::integer<int>::MinValue and type_safe::integer<int>::MaxValue to the type,
add |,&,<<,>>,^ operators

from type_safe.

Related Issues (20)

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.