summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-31 12:01:00 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-31 12:01:00 +0000
commitd20cf5f854fa5482c617d6ea355917435c98b038 (patch)
treec8e1b05d7f6f4170179a2e5f84d0e75502979423 /lib
parentInitial implementation for being able to click in the main window to select s... (diff)
downloadilt-d20cf5f854fa5482c617d6ea355917435c98b038.tar.bz2
ilt-d20cf5f854fa5482c617d6ea355917435c98b038.tar.xz
ilt-d20cf5f854fa5482c617d6ea355917435c98b038.zip
Allow glRef to accept lambdas
Diffstat (limited to 'lib')
-rw-r--r--lib/glRef.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/glRef.hpp b/lib/glRef.hpp
index 8596bd3..b33980d 100644
--- a/lib/glRef.hpp
+++ b/lib/glRef.hpp
@@ -4,9 +4,9 @@
#include <special_members.hpp>
#include <stdexcept>
-template<typename IdType, auto & get, auto & release, auto... fixed> class glRef {
+template<typename IdType, auto get, auto release, auto... fixed> class glRef {
public:
- template<typename... Args> explicit glRef(Args &&... args) : id {get(fixed..., std::forward<Args>(args)...)}
+ template<typename... Args> explicit glRef(Args &&... args) : id {(*get)(fixed..., std::forward<Args>(args)...)}
{
if (!id) {
throw std::runtime_error("Get function failed");
@@ -21,7 +21,7 @@ public:
~glRef()
{
if (id) {
- release(id);
+ (*release)(id);
}
}