Make the correct part of Node_ptr const

This commit is contained in:
Philipp Möller 2015-11-11 14:46:17 +01:00 committed by Sébastien Loriot
parent 901c27724b
commit b6e60ba6dc
2 changed files with 5 additions and 4 deletions

View File

@ -87,6 +87,8 @@ private:
typedef AABB_node<AABB_traits> Node;
typedef typename AABB_traits::Primitive Primitive;
public:
/// Helper functions
const Node& left_child() const
{ return *static_cast<Node*>(m_p_left_child); }
@ -97,8 +99,7 @@ private:
const Primitive& right_data() const
{ return *static_cast<Primitive*>(m_p_right_child); }
public:
private:
Node& left_child() { return *static_cast<Node*>(m_p_left_child); }
Node& right_child() { return *static_cast<Node*>(m_p_right_child); }
Primitive& left_data() { return *static_cast<Primitive*>(m_p_left_child); }

View File

@ -142,8 +142,8 @@ private:
struct Node_ptr_with_ft {
Node_ptr_with_ft(const Node* node, const FT& value, size_type nb_primitives)
: node(const_cast<Node*>(node)), value(value), nb_primitives(nb_primitives) {}
Node* node;
: node(node), value(value), nb_primitives(nb_primitives) {}
const Node* node;
FT value;
size_type nb_primitives;
bool operator<(const Node_ptr_with_ft& other) const { return value < other.value; }