diff --git a/Builds/VisualStudio2012/beast.vcxproj b/Builds/VisualStudio2012/beast.vcxproj index ab81dafc4d..27e6fbd844 100644 --- a/Builds/VisualStudio2012/beast.vcxproj +++ b/Builds/VisualStudio2012/beast.vcxproj @@ -146,6 +146,7 @@ + @@ -162,7 +163,6 @@ - @@ -569,7 +569,6 @@ true - true true diff --git a/Builds/VisualStudio2012/beast.vcxproj.filters b/Builds/VisualStudio2012/beast.vcxproj.filters index 97808dbe02..9caf855abd 100644 --- a/Builds/VisualStudio2012/beast.vcxproj.filters +++ b/Builds/VisualStudio2012/beast.vcxproj.filters @@ -279,9 +279,6 @@ {df4f2935-13a1-4afe-90cc-d86472ec2466} - - {793e2d61-14f6-4fa1-a17f-af6bbec13ba1} - {174b9125-76a7-4796-be97-79c2dcc751f1} @@ -1161,9 +1158,6 @@ beast\smart_ptr - - beast\stl - beast @@ -1245,6 +1239,9 @@ beast\asio + + beast + @@ -1775,9 +1772,6 @@ beast\smart_ptr\impl - - beast\stl - beast\insight diff --git a/beast/make_unique.h b/beast/make_unique.h new file mode 100644 index 0000000000..c48e7e0d3e --- /dev/null +++ b/beast/make_unique.h @@ -0,0 +1,93 @@ +//------------------------------------------------------------------------------ +/* + This file is part of Beast: https://github.com/vinniefalco/Beast + Copyright 2013, Vinnie Falco + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ +//============================================================================== + +#ifndef BEAST_MAKE_UNIQUE_H_INCLUDED +#define BEAST_MAKE_UNIQUE_H_INCLUDED + +#include + +namespace std { + +#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES + +template +std::unique_ptr make_unique () +{ + return std::unique_ptr (new T); +} + +template +std::unique_ptr make_unique (P1&& p1) +{ + return std::unique_ptr (new T (std::forward (p1))); +} + +template +std::unique_ptr make_unique (P1&& p1, P2&& p2) +{ + return std::unique_ptr (new T ( + std::forward (p1), std::forward (p2))); +} + +template +std::unique_ptr make_unique (P1&& p1, P2&& p2, P3&& p3) +{ + return std::unique_ptr (new T ( + std::forward (p1), std::forward (p2), std::forward (p3))); +} + +template +std::unique_ptr make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4) +{ + return std::unique_ptr (new T ( + std::forward (p1), std::forward (p2), std::forward (p3), + std::forward (p4))); +} + +template +std::unique_ptr make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4, P5&& p5) +{ + return std::unique_ptr (new T ( + std::forward (p1), std::forward (p2), std::forward (p3), + std::forward (p4), std::forward (p5))); +} + +template +std::unique_ptr make_unique (P1&& p1, P2&& p2, P3&& p3, P4&& p4, P5&& p5, P6&& p6) +{ + return std::unique_ptr (new T ( + std::forward (p1), std::forward (p2), std::forward (p3), + std::forward (p4), std::forward (p5), std::forward (p6))); +} + +//------------------------------------------------------------------------------ + +#else + +template +std::unique_ptr make_unique (Args&&... args) +{ + return std::unique_ptr (new T (std::forward (args)...)); +} + +#endif + +} + +#endif