diff options
| -rw-r--r-- | .clang-tidy | 2 | ||||
| -rw-r--r-- | pugl/pugl.hpp | 18 | 
2 files changed, 16 insertions, 4 deletions
| diff --git a/.clang-tidy b/.clang-tidy index 7e79698..c8039e1 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -8,8 +8,6 @@ Checks: >    -cert-flp30-c,    -clang-analyzer-alpha.*,    -clang-analyzer-security.FloatLoopCounter, -  -fuchsia-default-arguments-calls, -  -fuchsia-default-arguments-declarations,    -google-runtime-references,    -hicpp-multiway-paths-covered,    -hicpp-signed-bitwise, diff --git a/pugl/pugl.hpp b/pugl/pugl.hpp index 90036e4..3072560 100644 --- a/pugl/pugl.hpp +++ b/pugl/pugl.hpp @@ -274,7 +274,7 @@ private:  class World : public detail::Wrapper<PuglWorld, puglFreeWorld>  {  public: -	explicit World(WorldType type, WorldFlags flags = {}) +	explicit World(WorldType type, WorldFlags flags)  	    : Wrapper{puglNewWorld(static_cast<PuglWorldType>(type), flags)}  	    , _clock(*this)  	{ @@ -283,6 +283,14 @@ public:  		}  	} +	explicit World(WorldType type) +	    : World{type, {}} +	{ +		if (!cobj()) { +			throw std::runtime_error("Failed to create pugl::World"); +		} +	} +  	/// @copydoc puglGetNativeWorld  	void* nativeWorld() { return puglGetNativeWorld(cobj()); } @@ -394,6 +402,12 @@ public:  	virtual ~View() = default; +	View(const View&) = delete; +	View& operator=(const View&) = delete; + +	View(View&&)   = delete; +	View&& operator=(View&&) = delete; +  	const pugl::World& world() const { return _world; }  	pugl::World&       world() { return _world; } @@ -580,7 +594,7 @@ private:  	template<class Typed, class Base>  	static const Typed& typedEventRef(const Base& base)  	{ -		const Typed& event = static_cast<const Typed&>(base); +		const auto& event = static_cast<const Typed&>(base);  		static_assert(sizeof(event) == sizeof(typename Typed::BaseEvent), "");  		static_assert(std::is_standard_layout<Typed>::value, "");  		assert(event.type == Typed::type); | 
