From c7fe74dd6670c61c0607552269fdb1ba0970f048 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 17 May 2015 22:04:50 +0200 Subject: [PATCH] screen: provide const main() overload --- src/helpers.cpp | 1 + src/screen.h | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index 211957e6..b233b61d 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -21,6 +21,7 @@ #include #include +#include "enums.h" #include "helpers.h" #include "playlist.h" #include "statusbar.h" diff --git a/src/screen.h b/src/screen.h index 67ba2b31..2ec9d28e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -120,7 +120,9 @@ bool isVisible(BaseScreen *screen); template struct Screen : public BaseScreen { typedef WindowT WindowType; - typedef typename std::add_lvalue_reference::type WindowReference; + typedef typename std::add_lvalue_reference< + WindowType + >::type WindowReference; typedef typename std::add_lvalue_reference< typename std::add_const::type >::type ConstWindowReference; @@ -201,6 +203,9 @@ public: WindowReference main() { return w; } + ConstWindowReference main() const { + return w; + } protected: /// Template parameter that should indicate the main type