POV-Ray : Newsgroups : povray.off-topic : To anyone who has worked with boost : Re: To anyone who has worked with boost Server Time
28 Jul 2024 20:25:36 EDT (-0400)
  Re: To anyone who has worked with boost  
From: Warp
Date: 17 Feb 2013 02:47:49
Message: <51208b25@news.povray.org>
Anthony D. Baye <Sha### [at] spamnomorehotmailcom> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.