Apply changes applied from clang-modernize
Needed 1-2 cleanups by hand. 99% was automatic. * The version that ships with ubuntu 14.04 seems to not work. I had to build from scratch * Use cmake to generate the build commands that clang-modernize wants ```sh cmake -DCMAKE_EXPORT_COMPILE_COMMANDS:bool=true ../ChaiScript/ ``` * Use the clang-modernize tool. Note that you have to be pretty explicit about the include paths if you want it to also update your include files ```sh ../llvm-build/bin/clang-modernize ../ChaiScript/src/*.cpp -for-compilers=gcc-4.8 -include /home/jason/ChaiScript/include,/hjason/ChaiScript/include/chaiscript,/home/jason/ChaiScript/include/chaiscript/dispatchkit,/home/jason/ChaiScript/include/chaiscript/language -p compile_commands.json ``` * In my case, it left some unused `typedef`s behind, which I cleaned up.
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#ifndef CHAISCRIPT_ANY_HPP_
|
||||
#define CHAISCRIPT_ANY_HPP_
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace chaiscript {
|
||||
namespace detail {
|
||||
namespace exception
|
||||
@@ -27,7 +29,7 @@ namespace chaiscript {
|
||||
virtual ~bad_any_cast() CHAISCRIPT_NOEXCEPT {}
|
||||
|
||||
/// \brief Description of what error occured
|
||||
virtual const char * what() const CHAISCRIPT_NOEXCEPT
|
||||
virtual const char * what() const CHAISCRIPT_NOEXCEPT override
|
||||
{
|
||||
return m_what.c_str();
|
||||
}
|
||||
@@ -51,25 +53,25 @@ namespace chaiscript {
|
||||
template<typename T>
|
||||
struct Data_Impl : Data
|
||||
{
|
||||
Data_Impl(const T &t_type)
|
||||
Data_Impl(T t_type)
|
||||
: m_type(typeid(T)),
|
||||
m_data(t_type)
|
||||
m_data(std::move(t_type))
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~Data_Impl() {}
|
||||
|
||||
virtual void *data()
|
||||
virtual void *data() override
|
||||
{
|
||||
return &m_data;
|
||||
}
|
||||
|
||||
const std::type_info &type() const
|
||||
const std::type_info &type() const override
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
std::shared_ptr<Data> clone() const
|
||||
std::shared_ptr<Data> clone() const override
|
||||
{
|
||||
return std::shared_ptr<Data>(new Data_Impl<T>(m_data));
|
||||
}
|
||||
|
Reference in New Issue
Block a user