3 ms·
> json::Array commits = root_value.get_array(); You probably meant: json::Array & commits = root_value.get_array(); Don't really want to copy an array ther
by huhtenberg 14y ago
> json::Array commits = root_value.get_array();
You probably meant:
json::Array & commits = root_value.get_array();
Don't really want to copy an array there, right? After that you'll probably be tempted to use std::vector as a basis for json::array. Then you'll realize what an abysmal PoS default vector allocator is, and so you'd want to allow customizing it. Hello templates, and then before you know it, the whole thing not only looks like one of them incomprehensible boost beauties, but also compiles into a meg of code with a dozen dependencies. Neat :)
- zokier 14y ago> After that you'll probably be tempted to use std::vector as a basis for json::array. Then you'll realize what an abysmal PoS default vector allocator is, and so you'd want to allow customizing it. Hello templates, and then before you know it, the whole thing not only looks like one of them incomprehensible boost beauties, but also compiles into a meg of code with a dozen dependencies. Neat :) Writing good code means having discipline to resist all sorts of temptations, such as the one you describe. And not all slippery slopes are actually all that slippery. The one good thing about C++ is that you can pick the features you want and mostly ignore the rest. The reason C++ is so humungous is that everyone is using different subset of it.
- huhtenberg 14y ago> The reason C++ is so humungous is that everyone is using different subset of it. I completely agree with this. Incidentally, this is exactly the reason why C++ libraries are far less useful than the C ones.