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 { ... void operator()(_Tp* __ptr)…
> 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…
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…
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.begin(), vec2.end(),…
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…
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 { ... void operator()(_Tp* __ptr)…
> 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…
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…
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.begin(), vec2.end(),…
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…