[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
▼ Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: maxresdefault.jpg (180 KB, 1280x720)
180 KB JPG
>C++ adds string_view
>meant to be like C strings but smart

std::unordered_set< std::string > animals =
{
"dog", "cat", "cow"
};

const char *check1 = "pig";
std::string check2 = "pig";
std::string_view check3 = "pig";

if( animals.contains( check1 ) ) // valid C++

if( animals.contains( check2 ) ) // valid C++

if( animals.contains( check3 ) ) // invalid C++


the time you try to avoid c strings by refactoring with "proper" string_view you will realize along the way you actually can't do it because you lose 50% of functionality for some silly boomer reasons

is it time to get rid of the geriatric committee, by force if required?
>>
It's hilarious how /g/ glorifies C++ when it's objectively the worst programming language ever made, 2nd only to Rust.
>>
>doesn't understand how the language works
>makes a stupid thread
A thread died for this. Go to page 10 and reflect



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.