Cleanup: Add static assert for tree-view getter template
These kind of static asserts for the base type of a template parameter are useful, and can avoid wrong API usage.
This commit is contained in:
parent
aae5f15238
commit
332de3a2da
|
@ -455,6 +455,8 @@ inline ItemT &TreeViewItemContainer::add_tree_item(Args &&...args)
|
|||
|
||||
template<class TreeViewType> TreeViewType &AbstractTreeViewItemDropController::tree_view() const
|
||||
{
|
||||
static_assert(std::is_base_of<AbstractTreeView, TreeViewType>::value,
|
||||
"Type must derive from and implement the AbstractTreeView interface");
|
||||
return static_cast<TreeViewType &>(tree_view_);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue