4 ms·
What does that curly brace pair mean in isolation? auto ret = sp::call({"ls", "-l"}); It's not a lambda or a typical block. I don't think I've seen that befor
by hellofunk 11y ago
What does that curly brace pair mean in isolation?
auto ret = sp::call({"ls", "-l"});
It's not a lambda or a typical block. I don't think I've seen that before.
- catnaroek 11y agoIt's list initialization: http://en.cppreference.com/w/cpp/language/list_initialization http://en.cppreference.com/w/cpp/language/list_initializatio...
- ihaveajob 11y agoC++11 allows curly brace initialization: http://www.informit.com/articles/article.aspx?p=1852519 http://www.informit.com/articles/article.aspx?p=1852519
- msbarnett 11y agoSpecifically in this case it calls template<typename... Args> int call(std::initializer_list<const char*> plist, Args&&... args) Where "ls", and "-l" form the contents of the initializer list.
- deleted 11y ago[deleted]