In the code below Node_T is a std::shared_ptr, element_type will be Node< T,U >, and this type has member called root_;
Is there a way to shorten somehow this: Node_T::element_type::root_ to just root_?
template<class Node_T>
const Node_T& root(Node_T& node)
{
Node_T::element_type::root_ = node;
while (Node_T::element_type::root_->parent_)
{
Node_T::element_type::root_ = Node_T::element_type::root_->parent_;
}
return Node_T::element_type::root_;
}
If you are using C++0x; then the first line of function
root(Node_T&)can be,