wrong demo in downloaded docs

Feedback on the POCO Community website.
Posts: 1
Joined: 12 Nov 2010, 09:45

wrong demo in downloaded docs

Postby fwoncn » 12 Nov 2010, 10:03

I download the full docs from Poco site.
On this page: poco-1.3.6-all-doc/00100-GuidedTour.html, there is a teaser demonstrating the usage of ActiveMethod:

Code: Select all

#include "Poco/ActiveMethod.h"
#include "Poco/ActiveResult.h"
#include <utility>

using Poco::ActiveMethod;
using Poco::ActiveResult;

class ActiveAdder
    ActiveObject(): activeAdd(this, &ActiveAdder::add)

    ActiveMethod<int, std::pair<int, int>, ActiveAdder> add;

    int addImpl(const std::pair<int, int>& args)
        return args.first + args.second;

int main(int argc, char** argv)
    ActiveAdder adder;

    ActiveResult<int> sum = adder.add(std::make_pair(1, 2));
    // do other things
    std::cout << sum.data() << std::endl;

    return 0;

It still lacks a line of

Code: Select all

#include <iostream>

And the constructor should be written like this:

Code: Select all

 ActiveAdder() : add(this, &ActiveAdder::addImpl)

Posts: 1268
Joined: 11 Jul 2006, 16:27
Location: Austria

Re: wrong demo in downloaded docs

Postby guenter » 16 Nov 2010, 09:19

Thanks, this has already been fixed for the next release.

Return to “Site Feedback”

Who is online

Users browsing this forum: No registered users and 1 guest