Meet tuple_filter; it helps you filter the types inside a std::tuple or any tuple-like type based on a C++20 concepts (or older versions if you'd like).
Unfortunately we're not able to directly pass a C++20 concept as a template so the user of this type has to pass a
See the source code on the Compiler Explorer
I've also implemented this in another way long ago while implementing the"extension system" of this project.
Here's the source code of that implementation on GitHub.
Unfortunately we're not able to directly pass a C++20 concept as a template so the user of this type has to pass a
template<typename> typename template struct containing static constexpr bool value.See the source code on the Compiler Explorer
I've also implemented this in another way long ago while implementing the"extension system" of this project.
Here's the source code of that implementation on GitHub.
Github removing bans for Iranian residence.
Good, now can we remove the git and browser's proxy configurations for github!
Honestly I didn't expected github to do this; now I know other companies CAN do this but they just DON'T WANT TO.
Nat Friedman Tweet about this
My Reply to that tweet
Github blog post about this
Good, now can we remove the git and browser's proxy configurations for github!
Honestly I didn't expected github to do this; now I know other companies CAN do this but they just DON'T WANT TO.
Nat Friedman Tweet about this
My Reply to that tweet
Github blog post about this
I introduce you "recursively_replace_template_parameter" type which does exactly what the name says (suggest a better name if you know any).
It recursively replaces template parameters from the specified template type to the new specified template type.
This is particularly good for example when you want to replace std::allocator with std::pmr::polymorphic_allocator in a series of types.
For example, you can replace vector<string> with pmr::vector<pmr::string> with it.
On Godbolt
GitHub Link
It recursively replaces template parameters from the specified template type to the new specified template type.
This is particularly good for example when you want to replace std::allocator with std::pmr::polymorphic_allocator in a series of types.
For example, you can replace vector<string> with pmr::vector<pmr::string> with it.
On Godbolt
GitHub Link
Web++: A C++ Web Framework
I introduce you "recursively_replace_template_parameter" type which does exactly what the name says (suggest a better name if you know any). It recursively replaces template parameters from the specified template type to the new specified template type. β¦
And the code for those 4 TMP utilities are this. π
I should/could also add the non-type template parameter replacer as well, but the I don't need it; at least not yet.
You can find the source at the core/std/type_traits.hpp file in Web++ project.
Template meta programming could be better if the language maker do something about it. You can do really interesting stuff with it.
The purpose of this utility that I made was to make sure my allocator_pack can correctly and recursively replace all the allocators in the specified type with the new allocator type that we find is the best choice there.
This way, the fastest allocator in the allocator pack (or I should call it resource pack maybe) is chosen without the user (or the library) explicitly telling it what allocator it should use.
I should/could also add the non-type template parameter replacer as well, but the I don't need it; at least not yet.
You can find the source at the core/std/type_traits.hpp file in Web++ project.
Template meta programming could be better if the language maker do something about it. You can do really interesting stuff with it.
The purpose of this utility that I made was to make sure my allocator_pack can correctly and recursively replace all the allocators in the specified type with the new allocator type that we find is the best choice there.
This way, the fastest allocator in the allocator pack (or I should call it resource pack maybe) is chosen without the user (or the library) explicitly telling it what allocator it should use.
This is my first live coding on Instagram. what do you think?
#code #coding #programming #live #livecoding #cplusplus #cpp #dev #development #tech #technology #techie #webdev #web #webdesign #webdevelopment
https://www.instagram.com/tv/CKRiu5ujo2g/?igshid=eg82mly0orvv
#code #coding #programming #live #livecoding #cplusplus #cpp #dev #development #tech #technology #techie #webdev #web #webdesign #webdevelopment
https://www.instagram.com/tv/CKRiu5ujo2g/?igshid=eg82mly0orvv
Web++: A C++ Web Framework
This is my first live coding on Instagram. what do you think? #code #coding #programming #live #livecoding #cplusplus #cpp #dev #development #tech #technology #techie #webdev #web #webdesign #webdevelopment https://www.instagram.com/tv/CKRiu5ujo2g/?igshid=eg82mly0orvv
Here you can find it on YouTube.
YouTube
Live Coding (Working on cookies) | web++
This is my first live coding I've done on Instagram;Web++ Github project: https://github.com/the-moisrex/webpp
YouTube is finding one of my videos violating copyright;
It's me during live coding, the sound of my keyboard typing.
I guess I typed a music π
https://youtu.be/W9qYYFHcm2k?t=2267
It's me during live coding, the sound of my keyboard typing.
I guess I typed a music π
https://youtu.be/W9qYYFHcm2k?t=2267
Web++: A C++ Web Framework
Oops, I broke GCC again!
This git commit message should be a meme! Right? π
How much planning is too much planning? I do plan things a lot, sometimes too much! And that wastes so much time.
Specially when you're working on a big project that takes a long time to complete, you find out that you are wasting way too much time on rewriting the bad decisions of your past. And I think that is why I overthink some decisions now.
Doing small projects makes you think short term, but doing big projects makes you think way too much in the future than necessary.
I think we have to balance it by doing one big main project and many little smaller projects at the same time.
You have to be careful though. The joy of finishing smaller projects may overcome the joy of the big project's journey; and that's dangerous for your big project's health π
Specially when you're working on a big project that takes a long time to complete, you find out that you are wasting way too much time on rewriting the bad decisions of your past. And I think that is why I overthink some decisions now.
Doing small projects makes you think short term, but doing big projects makes you think way too much in the future than necessary.
I think we have to balance it by doing one big main project and many little smaller projects at the same time.
You have to be careful though. The joy of finishing smaller projects may overcome the joy of the big project's journey; and that's dangerous for your big project's health π
I just found out that I've had two different types of "HTTP request" types and I've been maintaining both of them.
They have totally difference ideas behind them.
And also I have a "context" type as well which is essentially an "extendable request" type.
I even confused myself!
I'm having a hard time merging them. One of them wasn't even being used in the process while other parts of the library assumed it was that type.
And it worked. Why? because in the first type I required "req.headers" to be present which is a "vector of header fields" while the other type had "req.headers()" function.
The tests were passing because I didn't have a "concept" for "Headers".
They have totally difference ideas behind them.
And also I have a "context" type as well which is essentially an "extendable request" type.
I even confused myself!
I'm having a hard time merging them. One of them wasn't even being used in the process while other parts of the library assumed it was that type.
And it worked. Why? because in the first type I required "req.headers" to be present which is a "vector of header fields" while the other type had "req.headers()" function.
The tests were passing because I didn't have a "concept" for "Headers".
3 type traits in web++ I had to add:
1. prepend_parameter: add a template parameter to the beginning of a tuple-like list.
2. append_parameter: append to the end.
3. unique_parameters: remove the duplicate types in a tuple-like templated type.
The code on the Compiler Explorer.
1. prepend_parameter: add a template parameter to the beginning of a tuple-like list.
2. append_parameter: append to the end.
3. unique_parameters: remove the duplicate types in a tuple-like templated type.
The code on the Compiler Explorer.
What do you think of my contributions on GitHub (mostly for this project)?
I honestly I could've done better than this if only I wasn't developing alone.
I probably won't be able to work on this project for at least 2 weeks; God knows what happens after that; but God willing if all goes well, I will not forget about this project and continue working on it since I have imagined so many great futures for this web framework.
Till I come back, you're welcome to toy around with the source codes and see you can do a few contributions; I sure will be happy to come back and see some contributions, big or small, even though I haven't seen that much of contributions so far.
I honestly I could've done better than this if only I wasn't developing alone.
I probably won't be able to work on this project for at least 2 weeks; God knows what happens after that; but God willing if all goes well, I will not forget about this project and continue working on it since I have imagined so many great futures for this web framework.
Till I come back, you're welcome to toy around with the source codes and see you can do a few contributions; I sure will be happy to come back and see some contributions, big or small, even though I haven't seen that much of contributions so far.
I am working on an "istring" (improved string) for my framework that will add some additional features to the STL strings (and also compatible string types as well) and you'd use it like:
That's a nice idea right?
I'm also working on unicode aware version as well.
I'll try to use as much as SIMD as possible in these kinda classes; I still haven't used them in the framework itself but they're a good tool to have.
Currently for SIMD stuff I'm using eve project; but of course, it's absolutely crucial to have enough benchmarks and tests for this kinda tools before putting them to use.
Maybe someday I have to use the std::simd proposal instead of eve project, but the author of eve project is just a great guy and even though it's fairly new project, it's a promising project.
Someone on this twitter thread mentioned that a free function is sometimes better, but I kinda like to have both options but I like the free function style to be more generalized (at least from the implementation point of view).
There's also this "ustring" template class as well which I'm trying to make it an alternative to std::string that supports unicode; so half of the implementation currently is a direct copy of GCC's implementation but I have to change most of them and remove lots of noise (which I have already at some extent) and also convert those GCC specific stuff to a more generalized implementations.
By any means these classes are finished and I'm still working on them but I'd be glad to have your support and help; there's so much to do and it's a lot of fun.
istring<std::string> str;Of course all of these algorithms are in the STL itself one way or another, but I'd like to have them in a way that's easier for the final user to use; including for example, nesting the member function calls and be happy that they're as fast as they can be. Also, we can use them with local allocators as well which is just amazing and hopefully results in a super fast codes.
istring<std::string_view> strv;
// ...
str.split(...);
str.replace(...);
auto new_str = strv.replace_copy(...).replace(...).split();
That's a nice idea right?
I'm also working on unicode aware version as well.
I'll try to use as much as SIMD as possible in these kinda classes; I still haven't used them in the framework itself but they're a good tool to have.
Currently for SIMD stuff I'm using eve project; but of course, it's absolutely crucial to have enough benchmarks and tests for this kinda tools before putting them to use.
Maybe someday I have to use the std::simd proposal instead of eve project, but the author of eve project is just a great guy and even though it's fairly new project, it's a promising project.
Someone on this twitter thread mentioned that a free function is sometimes better, but I kinda like to have both options but I like the free function style to be more generalized (at least from the implementation point of view).
There's also this "ustring" template class as well which I'm trying to make it an alternative to std::string that supports unicode; so half of the implementation currently is a direct copy of GCC's implementation but I have to change most of them and remove lots of noise (which I have already at some extent) and also convert those GCC specific stuff to a more generalized implementations.
By any means these classes are finished and I'm still working on them but I'd be glad to have your support and help; there's so much to do and it's a lot of fun.
Here you can find all of the C++20 features that's been added to the language:
https://oleksandrkvl.github.io/2021/04/02/cpp-20-overview.html
https://oleksandrkvl.github.io/2021/04/02/cpp-20-overview.html
Oleksandr Kovalβs blog
All C++20 core language features with examples
Introduction