Thread View: pl.comp.lang.funkcyjne
1 messages
1 total messages
Started by tytan15
Mon, 26 Feb 2007 18:34
Biblioteka boost::bind
Author: tytan15
Date: Mon, 26 Feb 2007 18:34
Date: Mon, 26 Feb 2007 18:34
18 lines
1366 bytes
1366 bytes
Mamy oto kod poniżej,
chcę by został uruchamiany konstruktor tytan(int,int)w klasie tytan w
szablonie boost::bind i nowoutworzony obiekt był zwracany to zmiennej c
typu tytan;
Proszę mnie nie pytać o zasadność takiego pytania,tylko jak da sie to zrobić
by niżej podany przykład kompilował się.
#include <boost/bind.hpp>
class tytan
{
tytan(int,int){};
};
int main()
{
tytan c=(boost::bind(&tytan,_1,_2))(1,2);//odpowiednik tytan c(1,2);
}
Kompilator wywala mnie następujace błędy:
stream.cpp: In function 'int main()':
stream.cpp:8: error: expected primary-expression before ',' token
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads