Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
cmma
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
by
cmma
11y ago
The reason why that code fails is explained by gcc's unique_ptr implementation: /// Primary template of default_delete, used by unique_ptr template<typename _Tp> struct default_delete { ..
2.
▲
by
cmma
11y ago
> You say you can do "some_command * .mp3"...true if either a) your command is safe to run with garbage input or b) you know that you have >= one file and no whitespace in filenames. Globbing preserves whitespace. It's
3.
▲
by
cmma
11y ago
In that case, the question should be, why am I attempting to convert one concrete type to another concrete type? If you're writing a program, you should use the same type, std::vector<char* >, everywhere. If you're writing a
4.
▲
by
cmma
11y ago
It sounds like you wanted to do something like this: std::vector<char*> vec1(...); std::vector<char const*> vec2(...); std::copy(vec1.begin(), vec1.end(), vec2.begin()); // works (1) std::copy(vec2.be
5.
▲
by
cmma
11y ago
Explain? The most common usage of const in library code is for function parameters: Iterator find(T const& value) const; The const actually _helps_ callers: find accepts both const and non-const references. A non-const argument