From e4adb22fa2b57a90e968bd9c8d83924421b0da70 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sat, 9 Apr 2016 05:06:30 +0800 Subject: [PATCH] fix a GCC compiler error --- include/nana/gui/widgets/listbox.hpp | 12 ++++++------ source/gui/widgets/listbox.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index e54b7415..eb6b31d3 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -74,7 +74,7 @@ namespace nana } template - const typename std::remove_const::type *get() + const typename std::remove_const::type *get() const { using value_type = typename std::remove_const::type; auto target = dynamic_cast*>(intern_); @@ -129,7 +129,7 @@ namespace nana virtual void assign(std::size_t pos, const std::vector& cells) = 0; virtual std::vector to_cells(std::size_t pos) const = 0; - virtual bool push_back(const_virtual_pointer&) = 0; + virtual bool push_back(const const_virtual_pointer&) = 0; virtual void * pointer() = 0; virtual const void* pointer() const = 0; @@ -214,7 +214,7 @@ namespace nana return translator_.to_cell(container_.at(pos)); } - bool push_back(const_virtual_pointer& dptr) override + bool push_back(const const_virtual_pointer& dptr) override { auto value = dptr.get(); if (value) @@ -303,7 +303,7 @@ namespace nana return translator_.to_cell(container_.at(pos)); } - bool push_back(const_virtual_pointer& dptr) override + bool push_back(const const_virtual_pointer& dptr) override { auto value = dptr.get(); if (value) @@ -385,7 +385,7 @@ namespace nana return ctrans_(container_.at(pos)); } - bool push_back(const_virtual_pointer& dptr) override + bool push_back(const const_virtual_pointer& dptr) override { throw std::runtime_error("nana::listbox disallow to remove items because of immutable model"); } @@ -997,7 +997,7 @@ namespace nana void inline_factory(size_type column, pat::cloneable> factory); private: void _m_append(std::vector && cells); - void _m_try_append_model(const_virtual_pointer&); + void _m_try_append_model(const const_virtual_pointer&); void _m_cat_by_pos(); void _m_update(); void _m_reset_model(model_interface*); diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 0ff2ff24..058dc61c 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -4601,7 +4601,7 @@ namespace nana } } - void cat_proxy::_m_try_append_model(const_virtual_pointer& dptr) + void cat_proxy::_m_try_append_model(const const_virtual_pointer& dptr) { if (!cat_->model_ptr) {