irrequietus / typestring Goto Github PK
View Code? Open in Web Editor NEWC++11/14 strings for direct use in template parameter lists, template metaprogramming.
License: Mozilla Public License 2.0
C++11/14 strings for direct use in template parameter lists, template metaprogramming.
License: Mozilla Public License 2.0
as it can be seen here: https://youtu.be/qNAbGpV1ZkU?t=513
typestring::sval
and return type of typestring::size
are both unsigned int
. While it seems std::size_t
would be more suitable and consistent with other parts of the language.
Note that sizeof...
(which is used to set the value of typestring::sval
) is defined by the standard to be a value of type std::size_t
:
The result of
sizeof
andsizeof...
is a constant of typestd::size_t
. [ Note:std::size_t
is defined in the standard header<cstddef>
(18.2). —end note ]
Working Draft, N3337, 2012-01-16 (newest I have at hand),
5.3.3 Sizeof ([expr.sizeof]), point 6
However inclusion of <cstddef>
would be needed as currently typestring.hh
doesn't include anything at all.
Вышел с аккаунта пополнить счёт а обратно уже никак не могу зайти. Пишет неверный логин или пароль. При попытке восстановить пароль пишет"В этом аккаунте не примён PGP ключ. Что делать если я правильно всё ввожу?
I am not really sure what I expected, but FYI, this header crashes Visual Studio 2017's compiler:
Thanks for this great class!!
(It took me a while to realize that it does exactly what I wanted!)
Please consider putting an example like this on the front-page:
#include "typestring.hh"
// wrapper to give any class T a fixed static name
template <typename T, typename NAME>
class MyClass : public T
{
public:
using T::T;
constexpr static const char *get_name() { return NAME::data(); }
};
#include <vector>
#include <iostream>
int main()
{
MyClass<std::vector<int>, typestring_is("vec0")> vec0{0, 2, 4};
MyClass<std::vector<int>, typestring_is("vec1")> vec1{1, 3, 5};
auto &container = vec0;
std::cout << container.get_name() << std::endl; // prints vec0
}
And consider mentioning typestring
over here
;)
I find that typestring_is("")
resolves to typestring<'\0'>
, but I expect it to resolve to typestring<>
.
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.