bronek / juno Goto Github PK
View Code? Open in Web Editor NEWSome C++17 metaprogramming
License: MIT License
Some C++17 metaprogramming
License: MIT License
#Member functions in type_set
have confusing names and ideally (some of them) should be renamed. Here is how function currently map to mathematical concepts, starting with creation of sets.
using A = type_set<>
using A = type_set<E, F>
B.is_in<A>()
B.is_in_setof<E>()
(it is a shortcut for B.is_in<type_set<E>>()
)B.is_in_setof<E, F, G>()
(a shortcut for B.is_in<type_set<E, F, G>>()
)B.is_in<type_set<>>()
or B.is_in_setof<>()
B.is_any<A>()
(or reverse, obviously; note B.is_any<type_set<>>()
is guaranteed to be false)B.is_any_setof<E, F, G>()
(it is a shortcut for B.is_any<type_set<E, F, G>>()
; note B.is_any_setof<>()
are guaranteed to be false)using C = decltype(A.join<B>())
(or typedef decltype(A.join<B>()) C
, or reverse, obviously)using C = decltype(A.join_setof<E, F>())
(it is a shortcut for using C = decltype(A.join<type_set<E, F>>())
)using C = decltype(A.cross<B>())
(or reverse, obviously)using C = decltype(A.cross_setof<E, F>())
(it is a shortcut for using C = decltype(A.cross<type_set<E, F>>())
)using C = decltype(A.less<B>())
using C = decltype(A.less_setof<E, F>())
(it is a shortcut for using C = decltype(A.less<type_set<E, F>>())
)Other function names seem OK, as they are consistent with other C++ libraries, for example:
B.is_same<A>()
(std::is_same
is similar although lower-level concept)A.empty()
A.size()
The challenge here is that I insist on names which are:
is_same
, size
and empty
should stay) andtype_set
.Functions which produce a new set should be verbs or mathematical terms. Last but not least, the function names should make sense mathematically, even if strict terminology is not followed (currently some of them do not make sense, e.g. is_in
is in fact reverse to implied meaning).
There is no helping to verbosity of syntax when using the library, i.e. sharp brackets or keywords using ... decltype
to return result from a function. This an unfortunate side effect of compile-time programming being an ugly duckling in the C++ language.
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.