canvas: Refactor with C++11

This commit is contained in:
Thomas Geymayer
2018-01-28 00:49:05 +01:00
parent 40534d6316
commit 087ea4c5f3
15 changed files with 211 additions and 243 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
#include <simgear_config.h>
#include "PropertyBasedElement.hxx"
#include <boost/algorithm/string/predicate.hpp>
#include <simgear/misc/strutils.hxx>
namespace simgear
{
@@ -130,7 +130,7 @@ namespace simgear
// character that followed it by the same character converted to ASCII
// uppercase.
if( !boost::starts_with(name, DATA_PREFIX) )
if( !strutils::starts_with(name, DATA_PREFIX) )
return std::string();
std::string data_name;
+7 -10
View File
@@ -20,6 +20,7 @@
#define SG_PROPERTY_BASED_ELEMENT_HXX_
#include <simgear/props/props.hxx>
#include <simgear/std/type_traits.hxx>
#include <simgear/structure/SGWeakReferenced.hxx>
namespace simgear
@@ -120,11 +121,9 @@ namespace simgear
* @see setDataProp
*/
template<class T>
typename boost::disable_if<
boost::is_same<T, SGPropertyNode*>,
T
>::type getDataProp( const std::string& name,
const T& def = T() ) const
std::enable_if_t<!std::is_same<T, SGPropertyNode*>::value, T>
getDataProp( const std::string& name,
const T& def = {} ) const
{
SGPropertyNode* node = getDataProp<SGPropertyNode*>(name);
if( node )
@@ -140,11 +139,9 @@ namespace simgear
* @see setDataProp
*/
template<class T>
typename boost::enable_if<
boost::is_same<T, SGPropertyNode*>,
T
>::type getDataProp( const std::string& name,
SGPropertyNode* = NULL ) const
std::enable_if_t<std::is_same<T, SGPropertyNode*>::value, T>
getDataProp( const std::string& name,
SGPropertyNode* = nullptr ) const
{
const std::string& attr = dataPropToAttrName(name);
if( attr.empty() )