Subject: Re: [boost] [mixin] Introducing a new library.
From: Borislav Stanimirov (b.stanimirov_at_[hidden])
Date: 2013-02-06 13:50:13
On 6.2.2013 Ð³. 16:57 Ñ., Matus Chochlik wrote:
> There are also a couple of things I would like to suggest:
> 1) Please add perfect forwarding (std::forward) to the macros and the caller#
> functions in gen/message_macros.ipp so that properties can be move-assigned.
I have this and much more C++11 features in mind, but I'm going to start
adding them after a couple of months, after I have a C++03 version I'm
happy with. Unfortunately lots of users still use C++03 and the C++11
support the popular compilers varies, and focusing on this now, will
prevent me from adding critical features, that I would like people to
> 2) Would it be possible to have object.implements<message>() in addition
> to object.implements(message_msg). IMO the former is more generic.
> From a glance at the implementation this would require some changes
> to the representation of messages, but it should be doable.
That would be a no. I mean it is technically possible, but I don't think
adding another representation of messages would help.
The plan is to stick to this simple rule of thumb:
When you're referring to a message, you use `<message_name>_msg`. When
calling a message you use `<method_name>`.
Remember the overloaded messages: they introduce different message names
for the same method name. Adding this feature would require me to have a
third way of referring to messages `<message_name>` without the _msg. It
would get confusing.
Now, I see that this makes things seem a bit inconsistent, but I have
really thought hard about the public interface. And considering all the
things I'm going to add to the library in the near future, this seems
like the best way to go.
For example messages are not going to remain the only mixin features.
Very soon I'll add "facts" which are static member constants within the
mixin class. In the more distant future I'll be adding serialization and
thread safety features and I will allow users to add some custom ones.
Imagine this (circa 2014):
BOOST_DEFINE_MIXIN(d3d_rendering, has_rendering_fact & max_buffers_fact
& paralelize(draw_msg) & log(load_data_msg) & debug(trace_msg) &
per_frame_memory_access_hint & block_serialization_hint)
> 3) Please add <some-message>(object&, <other-params>) in addition to
> <some-message>(object*, <other-params>), if possible.
Check. That's another thing that I had just forgotten (along with
object::implements). I'll add it by the end of the week.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk