anthonywilliams / strong_typedef Goto Github PK
View Code? Open in Web Editor NEWA class template that creates a new type that is distinct from the underlying type, but convertible to and from it
A class template that creates a new type that is distinct from the underlying type, but convertible to and from it
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.
I didn't spot the following operators:
Are these yet to be added?
Does op=
fit in this approach? If not, what about "do as the ints do"?
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?
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:
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
Is it C++17 or C++20?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.