From 6cda931465a0252bf832361edb3d1e6294ef9235 Mon Sep 17 00:00:00 2001 From: Frank Park Date: Sun, 9 Apr 2017 18:32:30 -0400 Subject: [PATCH] Add operator() to create query task --- include/sqlpp11/connection_pool.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/sqlpp11/connection_pool.h b/include/sqlpp11/connection_pool.h index 007ccfd1..805d6246 100644 --- a/include/sqlpp11/connection_pool.h +++ b/include/sqlpp11/connection_pool.h @@ -24,6 +24,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#pragma once + #ifndef SQLPP_CONNECTION_POOL_H #define SQLPP_CONNECTION_POOL_H @@ -36,6 +38,7 @@ #include #include #include +#include namespace sqlpp { @@ -206,6 +209,12 @@ namespace sqlpp throw sqlpp::exception("Failed to spawn a new connection."); } } + + template + void operator()(Query query, Lambda callback) + { + query_task(*this, query, callback)(); + } }; template