memesearch
C++11 Trim Functions

C++11 Trim Functions

Download Find similar pictures
Text on the meme
For C++11 #include <algorithm> #include <cctype> #include <locale> // Trim from the start (in place) inline void ltrim(std::string &s) { s.erase(s.begin(), std::find_if(s.begin(), s.end(), return !std::isspace(ch); })); } // Trim from the end (in place) inline void rtrim(std::string &s) { s.erase(std::find_if(s.begin(), s.rend(), [](unsign return !std::isspace(ch); }).base(), s.end()); } Thanks to std::ptr_fun replacement for C++17 for bringing up the modern solution.
What it means

A programming post shows verbose C++11 functions for trimming whitespace from the beginning and end of a string. The joke is that an old, cumbersome C++11 solution is presented as the “modern solution,” while the caption points out that a C++17 replacement for std::ptr_fun is responsible for it. It is used as a reaction to the complexity and awkward evolution of C++ standards. EN: A programming post shows verbose C++11 functions for trimming whitespace from the beginning and end of a string. The joke is that an old, cumbersome C++11 solution is presented as the “modern solution,” while the caption points out that a C++17 replacement for std::ptr_fun is responsible for it. It is used as a reaction to the complexity and awkward evolution of C++ standards.

Objects
Tags
Source
Type
image
Size
800×675 · 68.9 KiB
Mood
sarcastic, absurd
Language
en
Added