logoalt Hacker News

Joker_vD • today at 3:41 PM • 2 replies • view on HN

> Yes there are bad parts in the C++ standard library and there are good parts.

Okay, other than <vector>, what are the good parts? Because as the sibling comments rightfully point out, migrating your codebase from C to C++ just to be able to use <vector> is not worth it.

The <map> is a sad joke played upon the C++ programmers by the standard committee.


Replies

pjmlp • today at 3:47 PM

Strings, something that C still doesn't do properly, not even having something like SDS into the standard library.

<map> does the work just fine, not everyone has winning microbenchmarks as part of their daily work.

➕ show 2 replies
kccqzy • today at 5:03 PM

So what? You like <vector>, and make it the only allowed include. Write all other type safe generic data structures by hand using C++ syntax. Problem solved. In fact many old codebases migrated from C already has their own implementations of strings and vectors and hash tables, so these projects can totally forbid the C++ standard library versions in favor of their own versions, and only pull in <type_traits> for easier type safe generic data structure programming.