From 9602e5fa2668cd6bc4f32efcc0491e315cb77e4b Mon Sep 17 00:00:00 2001 From: Denis Blank Date: Mon, 8 Jun 2015 22:44:14 +0200 Subject: [PATCH] more tests --- fluent++/fluent++.hpp | 34 +++++++++++++++++++++++++++++++++- test.cpp | 6 +++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/fluent++/fluent++.hpp b/fluent++/fluent++.hpp index 3752f22..218a704 100644 --- a/fluent++/fluent++.hpp +++ b/fluent++/fluent++.hpp @@ -2,10 +2,42 @@ #ifndef _FLUENT_HPP_ #define _FLUENT_HPP_ +#include +#include + #include "functional_unwrap.hpp" -struct fluent_step +class fluent_step { + bool released; + + void release() + { + int i = 0; + } + +public: + fluent_step() : released(false) { } + + ~fluent_step() + { + if (!released) + release(); + } + + fluent_step(fluent_step const&) = delete; + fluent_step(fluent_step&& right) : released(false) + { + right.released = true; + } + + fluent_step& operator= (fluent_step const&) = delete; + fluent_step& operator= (fluent_step&& right) + { + released = false; + right.released = true; + } + template fluent_step& then(Callback const& callback) { diff --git a/test.cpp b/test.cpp index 5622374..de22ea4 100644 --- a/test.cpp +++ b/test.cpp @@ -6,7 +6,11 @@ int main(int argc, char** argv) make_waterfall() .then([] { - + + }) + .then([] + { + }); return 0;