I softened the tone of the read a bit so it isnt as eye poking.To do lists are effective in helping you get things done. I wrote it as my experience when I delved into the topic and I guess I got burnt-out. Discuss.ĮDIT: Looks like this post read out bit of as rant in hindsight. This makes writing template code handling functions messier than I think it should be. And by that I mean you can't describe an instance nor type of overload-set thing by name within the C++17 language without work-arounds. The C++ language pretends there is no such thing as "named overload-set of math::sum". ![]() So what math::sum actually is in C++ language? Nothing. &math::sum is not an real value nor type either, at least until you convert it into member-function pointer of specific type in the same sentence. The "black hole": math::sum is not an object, type or an value but an overload-set of member-function sum in struct math. ![]() Why? First std::invoke() needs an invocable object math::sum is an templated member-function so what is the problem? (It is still daunting to figure out why it did go wrong) -)īut because bind_front() deals with callables/invocable things I discovered an issue in C++ template meta programming: You cannot pass things as names via template argument! That is following does not compile: ![]() I learned the template and type deduction basics and I can now argue with the compiler spewing out +50 lines of template errors without getting horrified. With C++17 I started to write C++20 bind_front() like equivalent in C++17. I never took the time to learn how to do the magic of C++ template meta programming. I have been an long standing developer from pre C++11 days up C++17 in daily use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |