Tidy up for C++11, and fixes:

* Remove shared_ptr legacy support
* Add make_unique support for pre-C++14 environments
* Fix comparison bug in sqdb
* Use std::shared_ptr in a few places
This commit is contained in:
Vinnie Falco
2014-01-16 18:29:30 -05:00
parent fa10e90c9d
commit c341d1a71e
20 changed files with 49 additions and 107 deletions

View File

@@ -162,7 +162,6 @@
<ClInclude Include="..\..\beast\smart_ptr\SharedObject.h" />
<ClInclude Include="..\..\beast\smart_ptr\SharedPtr.h" />
<ClInclude Include="..\..\beast\StaticAssert.h" />
<ClInclude Include="..\..\beast\STL.h" />
<ClInclude Include="..\..\beast\Strings.h" />
<ClInclude Include="..\..\beast\strings\CharacterFunctions.h" />
<ClInclude Include="..\..\beast\strings\CharPointer_ASCII.h" />

View File

@@ -1158,9 +1158,6 @@
<ClInclude Include="..\..\beast\smart_ptr\AbstractObject.h">
<Filter>beast\smart_ptr</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\STL.h">
<Filter>beast</Filter>
</ClInclude>
<ClInclude Include="..\..\beast\Insight.h">
<Filter>beast</Filter>
</ClInclude>

View File

@@ -1,25 +0,0 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
#ifndef BEAST_STL_H_INCLUDED
#define BEAST_STL_H_INCLUDED
#include "stl/shared_ptr.h"
#endif

View File

@@ -20,7 +20,6 @@
#ifndef BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
#define BEAST_INSIGHT_COUNTERIMPL_H_INCLUDED
#include <functional>
#include <memory>
namespace beast {

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED
#define BEAST_INSIGHT_GAUGEIMPL_H_INCLUDED
#include <functional>
#include <memory>
namespace beast {
namespace insight {

View File

@@ -22,7 +22,7 @@
#include "HookImpl.h"
#include "../stl/shared_ptr.h"
#include <memory>
namespace beast {
namespace insight {

View File

@@ -22,7 +22,7 @@
#include "MeterImpl.h"
#include "../stl/shared_ptr.h"
#include <memory>
namespace beast {
namespace insight {

View File

@@ -24,6 +24,12 @@
namespace std {
#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
# ifdef _MSC_VER
# define BOOST_NO_CXX11_VARIADIC_TEMPLATES
# endif
#endif
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
template <class T>

View File

@@ -1,22 +0,0 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
#include "BeastConfig.h"
#include "shared_ptr.h"

View File

@@ -1,33 +0,0 @@
//------------------------------------------------------------------------------
/*
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.
*/
//==============================================================================
#ifndef BEAST_STL_SHARED_PTR_H_INCLUDED
#define BEAST_STL_SHARED_PTR_H_INCLUDED
#include <boost/smart_ptr.hpp>
namespace beast {
using boost::shared_ptr;
using boost::make_shared;
using boost::enable_shared_from_this;
}
#endif

View File

@@ -61,7 +61,6 @@
#include "../../beast/Threads.h"
#include "../../beast/Utility.h"
#include "../../beast/Chrono.h"
#include "../../beast/STL.h"
#include "system/StandardIncludes.h"

View File

@@ -139,7 +139,8 @@ Error session::open(String fileName, std::string options)
std::stringstream ssconn(options);
while (!err && !ssconn.eof() && ssconn.str().find('=') >= 0)
while (!err && !ssconn.eof() &&
ssconn.str().find('=') != std::string::npos)
{
std::string key, val;
std::getline(ssconn, key, '=');