screen: provide const main() overload
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "enums.h"
|
||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
#include "playlist.h"
|
#include "playlist.h"
|
||||||
#include "statusbar.h"
|
#include "statusbar.h"
|
||||||
|
|||||||
@@ -120,7 +120,9 @@ bool isVisible(BaseScreen *screen);
|
|||||||
template <typename WindowT> struct Screen : public BaseScreen
|
template <typename WindowT> struct Screen : public BaseScreen
|
||||||
{
|
{
|
||||||
typedef WindowT WindowType;
|
typedef WindowT WindowType;
|
||||||
typedef typename std::add_lvalue_reference<WindowType>::type WindowReference;
|
typedef typename std::add_lvalue_reference<
|
||||||
|
WindowType
|
||||||
|
>::type WindowReference;
|
||||||
typedef typename std::add_lvalue_reference<
|
typedef typename std::add_lvalue_reference<
|
||||||
typename std::add_const<WindowType>::type
|
typename std::add_const<WindowType>::type
|
||||||
>::type ConstWindowReference;
|
>::type ConstWindowReference;
|
||||||
@@ -201,6 +203,9 @@ public:
|
|||||||
WindowReference main() {
|
WindowReference main() {
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
ConstWindowReference main() const {
|
||||||
|
return w;
|
||||||
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Template parameter that should indicate the main type
|
/// Template parameter that should indicate the main type
|
||||||
|
|||||||
Reference in New Issue
Block a user