Skip to content

Instantly share code, notes, and snippets.

@b4284
Created September 8, 2016 17:03
Show Gist options
  • Select an option

  • Save b4284/615cba54d746eacb83a433be8b0f29cd to your computer and use it in GitHub Desktop.

Select an option

Save b4284/615cba54d746eacb83a433be8b0f29cd to your computer and use it in GitHub Desktop.
#include <initializer_list>
#include <utility>
#include <string>
void d(std::initializer_list<std::pair<std::string&, const char*>> dirs) {
for (auto k : dirs) {
k.first = k.second;
}
}
int main(void) {
std::string f;
d({ std::make_pair(f, "a") });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment