Skip to content

Instantly share code, notes, and snippets.

@Naios
Last active August 29, 2015 14:21
Show Gist options
  • Save Naios/adc8fb606c84acc4e4b6 to your computer and use it in GitHub Desktop.
Save Naios/adc8fb606c84acc4e4b6 to your computer and use it in GitHub Desktop.
struct Fluent
{
template <typename T>
using Callback = std::function<void(T)>;
template <typename T>
Fluent& doSomething(Callback<T> const& t)
{
return *this;
}
};
int main(int argc, char** argv)
{
Fluent fluent;
fluent
.doSomething([](int t)
{
})
.doSomething([](float t)
{
});
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment