<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Probleme mit boost::thread_group in einer Klasse]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar hätte ich folgendes vor:</p>
<pre><code class="language-cpp">// Header

class System{
private:
	boost::thread_group threads;

	void initialize();
	void TCPServer(unsigned short _port = 0);
public:
	System();
	~System();
	void instanceServer(unsigned short _port);
	void instanceClient();
};

// Source
System::System() {
	initialize();
}

System::~System() {
	this-&gt;threads.join_all();
}

void System::initialize() {
}

void System::instanceServer(unsigned short _port) {
	// Server
	this-&gt;threads.create_thread(boost::bind(&amp;System::TCPServer, _port));
}

void System::instanceClient() {
}

void System::TCPServer(unsigned short _port) {
	// Mach was
}

// Hauptprogramm
int main(int argc, char* argv[]) {
	System *sys = new System();
	sys-&gt;instanceServer(80);
	return 0;
}
</code></pre>
<p>Wenn ich das kompilieren möchte erhalte ich folgende Fehlermeldung:</p>
<pre><code>c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(18) : error C2091: function returns function
system.cpp(19) : see reference to class template instantiation 'boost::_bi::bind_t&lt;R,F,L&gt;' being compiled
        with
        [
            R=void (unsigned short),
            F=boost::_mfi::dm&lt;void (unsigned short),System&gt;,
            L=boost::_bi::list1&lt;boost::_bi::value&lt;unsigned short&gt;&gt;
        ]
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(24) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(29) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(35) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(41) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(47) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(53) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(59) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(65) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(71) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(77) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(83) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(89) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(95) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(101) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(107) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(113) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(119) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(125) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(131) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(137) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(142) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(318) : warning C4180: qualifier applied to function type has no meaning; ignored
        c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(160) : see reference to class template instantiation 'boost::_mfi::dm&lt;R,T&gt;' being compiled
        with
        [
            R=void (unsigned short),
            T=System
        ]
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(326) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(336) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(350) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(355) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(369) : warning C4180: qualifier applied to function type has no meaning; ignored
</code></pre>
<p>Kann mir jemand sagen helfen wie ich es fertig bekomme das ich eine Methode mit boost::threads mit und ohne argumente aufrufen kann?</p>
<p>Vielen Dank im Voraus</p>
<p>_freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185939/probleme-mit-boost-thread_group-in-einer-klasse</link><generator>RSS for Node</generator><lastBuildDate>Thu, 24 Sep 2026 06:17:38 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185939.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Jul 2007 10:41:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit boost::thread_group in einer Klasse on Tue, 03 Jul 2007 10:41:39 GMT]]></title><description><![CDATA[<p>Hey @all,</p>
<p>und zwar hätte ich folgendes vor:</p>
<pre><code class="language-cpp">// Header

class System{
private:
	boost::thread_group threads;

	void initialize();
	void TCPServer(unsigned short _port = 0);
public:
	System();
	~System();
	void instanceServer(unsigned short _port);
	void instanceClient();
};

// Source
System::System() {
	initialize();
}

System::~System() {
	this-&gt;threads.join_all();
}

void System::initialize() {
}

void System::instanceServer(unsigned short _port) {
	// Server
	this-&gt;threads.create_thread(boost::bind(&amp;System::TCPServer, _port));
}

void System::instanceClient() {
}

void System::TCPServer(unsigned short _port) {
	// Mach was
}

// Hauptprogramm
int main(int argc, char* argv[]) {
	System *sys = new System();
	sys-&gt;instanceServer(80);
	return 0;
}
</code></pre>
<p>Wenn ich das kompilieren möchte erhalte ich folgende Fehlermeldung:</p>
<pre><code>c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(18) : error C2091: function returns function
system.cpp(19) : see reference to class template instantiation 'boost::_bi::bind_t&lt;R,F,L&gt;' being compiled
        with
        [
            R=void (unsigned short),
            F=boost::_mfi::dm&lt;void (unsigned short),System&gt;,
            L=boost::_bi::list1&lt;boost::_bi::value&lt;unsigned short&gt;&gt;
        ]
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(24) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(29) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(35) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(41) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(47) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(53) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(59) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(65) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(71) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(77) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(83) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(89) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(95) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(101) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(107) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(113) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(119) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(125) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(131) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(137) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(142) : error C2091: function returns function
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(318) : warning C4180: qualifier applied to function type has no meaning; ignored
        c:\boost_80\include\boost-1_33_1\boost\bind\bind_template.hpp(160) : see reference to class template instantiation 'boost::_mfi::dm&lt;R,T&gt;' being compiled
        with
        [
            R=void (unsigned short),
            T=System
        ]
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(326) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(336) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(350) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(355) : warning C4180: qualifier applied to function type has no meaning; ignored
c:\boost_80\include\boost-1_33_1\boost\mem_fn.hpp(369) : warning C4180: qualifier applied to function type has no meaning; ignored
</code></pre>
<p>Kann mir jemand sagen helfen wie ich es fertig bekomme das ich eine Methode mit boost::threads mit und ohne argumente aufrufen kann?</p>
<p>Vielen Dank im Voraus</p>
<p>_freeze_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317396</guid><dc:creator><![CDATA[_freeze_]]></dc:creator><pubDate>Tue, 03 Jul 2007 10:41:39 GMT</pubDate></item></channel></rss>