aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-09-19 13:22:17 +0200
committerDavid Robillard <d@drobilla.net>2020-09-19 18:51:33 +0200
commit181bd895918c341e0a2ef1d0558a591028bf2d7d (patch)
tree6dcf8fe1d5aae548723663ffcff72788027ae850 /pugl
parentd70aa80d71299c24ebd71537cfd620eff2b7e50d (diff)
downloadpugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.tar.gz
pugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.tar.bz2
pugl-181bd895918c341e0a2ef1d0558a591028bf2d7d.zip
Fix clang-tidy warnings
Diffstat (limited to 'pugl')
-rw-r--r--pugl/pugl.hpp18
1 files changed, 16 insertions, 2 deletions
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);