Json config loader class Currently the class takes a json file and retrieves data from it, and i'd like to improve this class.
ConfigLoader.h
#ifndef LEVELEDITOR_CONFIGLOADER_H
#define LEVELEDITOR_CONFIGLOADER_H

#include &lt;string&gt;
#include &lt;json/json.h&gt;
#include &lt;stdexcept&gt;
#include &lt;fstream&gt;

namespace Editor
{
    class JsonInit
    {
    public:
        JsonInit()
        {
            std::ifstream inputFile(&quot;config.json&quot;);
            if (inputFile.bad())
            {
                throw std::runtime_error(&quot;could not load config file&quot;);
            }

            inputFile &gt;&gt; _root;
        }

        inline Json::Value&amp; getRoot() { return _root; }

    private:
        Json::Value _root;
    };

    class ConfigLoader
    {
    public:
        inline static int loadInt(const std::string key) {return json.getRoot().get(key, -1).asInt(); }
        inline static std::string&amp; loadString(const std::string key) {return json.getRoot().get(key, -1).asString();}

    private:

        static JsonInit json;
    };
}

#endif // LEVELEDITOR_CONFIGLOADER_H

ConfigLoader.cpp
#include &quot;configloader.h&quot;

Editor::JsonInit Editor::ConfigLoader::json;

Edit: forgot to say the &quot;config.json&quot; path is temporary, as i wish to make it possible to let the user choose
It appears that the file ConfigLoader.cpp is unnecessary unless you are just providing an example of usage.
The keyword inline is obsolete, it is really only a suggestion these days. Modern C++ compilers will make the decision on whether the code should be inlined or not when using the -O3 switch.
If you are going to let the user define the config file name, then pass the name into the constructor and default it at a higher level.