Skip to content

Instantly share code, notes, and snippets.

@welll
Last active January 20, 2016 16:56
Show Gist options
  • Save welll/0fc2a1285d2b196f9481 to your computer and use it in GitHub Desktop.
Save welll/0fc2a1285d2b196f9481 to your computer and use it in GitHub Desktop.
C++ - namespace
using namespace foo; //generic, the same behaviour in Java, include com.foo.*
using bar;// specific, the same behaviour in Java, include com.package.bar;
void function_test(std::string a, std::function<void (const string&)> original_function{
std::sting b = create_random_string();
return [b, original_function](const string_t& c)
{
if (validate(b, c))
{
original_function(c);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment