Skip to content
Discussion options

You must be logged in to vote

Thank you for this interesting library!

Thanks! And sorry for the belated reply, I missed the issue. Gotta set some
email rules...

What I am doing wrong?

There are a couple of issues here, but nothing major.

template<typename T>
using value = method<BOOST_OPENMETHOD_ID(value),
                     T(virtual_ptr<const Node<T>> node)>;

template<typename T>
T plus_value(virtual_ptr<const Plus<T>> plus) {
  return value(plus->left) + value(plus->right);
}

value is a class template and you are calling it as a function. The correct syntax is:

template<typename T>
T plus_value(virtual_ptr<const Plus<T>> plus) {
  return value<T>::fn(plus->left) + value<T>::fn(plus->right);
}

Secondly, this …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jll63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #67 on April 08, 2026 21:43.