Joel de Guzman writes:
[...]
That's a good workaround, but really, we ought to have read-only
adaptors. Doing above would still allow elem = val; albeit will
be a no-op.
Please add a trac "feature request" ticket, if you will.
Regards,
A simple workaround is to fall back to an invalid expression.
--8<---------------cut here---------------start------------->8---
#include
#include
template<typename>struct dummy{};
template<typename T>
typename dummy<T>::this_type_does_not_exist
invalid_operation(T const&)
{}
class A{};
BOOST_FUSION_ADAPT_ADT(A,(int,int,1,invalid_operation(val)))
int main()
{
A a;
boost::fusion::front(a)=1;
}
--8<---------------cut here---------------end--------------->8---
This should give a nice and readable error message.
-Christopher