|
![](/i/fill.gif) |
Anthony D. Baye <Sha### [at] spamnomore hotmail com> wrote:
> The problem I'm having, at the moment, is that the explanation (Explicitly for
> Beginners) in the boost documentation seems rather confusing, to say the least.
> They "begin" by introducing "an object with a slot" in the form of a struct with
> an overloaded ()() operator... How is this a "Beginner" tutorial, again?
Uh... I don't think they are talking about "beginner C++ programmer"
tutorial. Rather, "beginner to Boost signals" tutorial.
If you are using a library like Boost, it can be safely assumed that you
know your way around C++ already.
Writing a functor (iow. an object that behaves like a function) should be
trivial at that point.
> And I'll set aside my prejudices about
> the use of structs, which are likely irrational anyway.
What exactly is the problem with them?
(They are used there just for brevity. You could just as well use a class
if you want. In simple cases a struct will do just fine on itself, though.)
> Now here's my problem: Slots are functions. it would make more sense to me, to
> start with a simple, unadorned function, and connect it with a signal.
As said, if you are using a library like Boost, one could assume you are
already fluent in C++, and that functors are as trivial to you as plain
functions.
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |