2014-02-16 19:43:16 -08:00
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
/*
|
|
|
|
|
This file is part of Beast: https://github.com/vinniefalco/Beast
|
|
|
|
|
Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com>
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
*/
|
|
|
|
|
//==============================================================================
|
|
|
|
|
|
2014-03-03 13:37:07 -08:00
|
|
|
#ifndef BEAST_CXX14_MEMORY_H_INCLUDED
|
|
|
|
|
#define BEAST_CXX14_MEMORY_H_INCLUDED
|
2014-02-16 19:43:16 -08:00
|
|
|
|
2014-05-29 11:59:36 -07:00
|
|
|
#include <beast/cxx14/config.h>
|
2014-03-03 13:37:07 -08:00
|
|
|
|
|
|
|
|
#include <memory>
|
2014-02-16 19:43:16 -08:00
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
|
|
2014-03-03 13:37:07 -08:00
|
|
|
#if ! BEAST_NO_CXX14_MAKE_UNIQUE
|
|
|
|
|
template <class T, class... Args>
|
|
|
|
|
std::unique_ptr <T> make_unique (Args&&... args)
|
2014-02-16 19:43:16 -08:00
|
|
|
{
|
2014-03-03 13:37:07 -08:00
|
|
|
return std::unique_ptr <T> (new T (std::forward <Args> (args)...));
|
|
|
|
|
}
|
2014-02-16 19:43:16 -08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|