Last active
August 29, 2015 14:21
-
-
Save Naios/adc8fb606c84acc4e4b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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