P0618RO: “…The entire header
<codecvt> (which does not contain the class
codecvt!) is deprecated, as are the utilities
wbuffer_convert. These features are hard to use correctly, and there are doubts about whether they are even specified correctly. Users should use dedicated text-processing libraries instead…”
(update: for the comprehensive “all in one” solution please head here )
codecvt is, officially, irrevocably, gone. For good. Deprecated. And there is this highly suspicious: “Text-processing libraries” advice . Panic? Please don’t.
Does this actually apply to you? My advice: “Stay cool calm and collected and all things will fall into place”. Read on. Continue reading
[Note: metacall base article]
I am currently in the stage of searching for simple but valid examples of metacall validity (aka: usefulness) as interfacing concept and programming idiom.
And, I think I have found one. metacall + project Euler. The mathematical nature of some computational problems make them a great fit for the functional paradigm. For those of you who don’t know, “Project Euler is a series of challenging mathematical/computer programming problems…” (ProjectEuler.net). I have concluded I could use the simple and interesting solution for a problem from “Project Euler” to show metacall in action.
In this post, I have improved the
dbj::print() lambda from the part one.
Allow me to analyze it for you in a bit of a detail. First what you like most, the code.
(Alternatively if you feel brave and kind of a clear headed, feel free to snub this beginners text and jump straight to Part 3 )
Your API usability does matter indeed. It is not just some snazzy implementation behind, displayed on the GitHub to boast about. Think of your users, clients and customers. What they see first and judge your quality for, is your API design.
Why do grown-ups use C or C++. Let me start a mini series here.
Garbage Collection is a first problem with many “modern” and popular runtime environments and their programing languages relying on the one.
Update: I have added page 4 “User Manual”
Update: I have expanded “Option 2” with a working solution. And hopefully explained why is it very likely, still a stunt.
Stunt programming? Here is one definition. From C2 wiki
Doing things the hard or risky way because it is more exciting (and exciting is FUN…until you crash).
I could not agree more with this definition. I have also given practical example using C#, on the same subject sometimes ago.
Modern C++ provides a LOT of opportunity to engage and get one self lost in this kind of programming.
(This is one fairly long post with a lot of C++ code inside. For newcomers to the modern C++, but not for the beginners. )
strnlen? I am reasonably sure it is not me who first thought of this, but today, I figured writing a “zero time”
strnlen() in modern C++ is actually possible and obvious. Not for pointers though.
And not only for string literals this is. Even better, for any kind of native array. Continue reading