🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.funkcyjne
Article #869

Biblioteka boost::bind

#869
From: tytan15
Date: Mon, 26 Feb 2007 18:34
18 lines
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
Technical Details
Message-ID: <erv991$k1v$1@news.onet.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!not-for-mail
From: "tytan15@poczta.onet.pl" <tytan15@poczta.onet.pl>
Newsgroups: pl.comp.lang.c,pl.comp.lang.funkcyjne
Subject: Biblioteka boost::bind
Followup-To: pl.comp.lang.c
Date: Mon, 26 Feb 2007 19:34:00 +0100
Organization: Onet.pl
Lines: 20
Message-ID: <erv991$k1v$1@news.onet.pl>
NNTP-Posting-Host: bus178.internetdsl.tpnet.pl
Mime-Version: 1.0
X-Trace: news.onet.pl 1172514913 20543 83.18.174.178 (26 Feb 2007 18:35:13 GMT)
X-Complaints-To: usenet@news.onet.pl
NNTP-Posting-Date: Mon, 26 Feb 2007 18:35:13 +0000 (UTC)
X-Sender: D9kyzi+Zr8E7LEDWBZNKow==
User-Agent: KNode/0.10.4
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit