Re: [Boost-users] Boost-users Digest, Vol 2679, Issue 1
Thanks Andreas Wehrmann.
if worked after including boost/function.hpp.
I am still wondering what changes boost has made while moving from 1.41 to 1.44 that has made users to explicitly include "function.hpp" This code was compiling with 1.41 without including boost/function.hpp
Thank You,
Gaurav
-----Original Message-----
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of boost-users-request@lists.boost.org
Sent: Friday, April 01, 2011 11:34 AM
To: boost-users@lists.boost.org
Subject: Boost-users Digest, Vol 2679, Issue 1
Send Boost-users mailing list submissions to
boost-users@lists.boost.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.boost.org/mailman/listinfo.cgi/boost-users
or, via email, send a message with subject or body 'help' to
boost-users-request@lists.boost.org
You can reach the person managing the list at
boost-users-owner@lists.boost.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Boost-users digest..."
Today's Topics:
1. Re: [boost::mutex] Do they block or wait? (Ovanes Markarian)
2. Re: [Lambda] nitty gritty detail...? (Robert Jones)
3. Re: [Lambda] nitty gritty detail...? (Steven Watanabe)
4. VS2010+boost 1.44 - error in move.hpp (archie14)
5. [boost] [program options] Potential bug in parsing arguments
where one is suffix of the other ? (Sanjit Jhala)
6. [MPL] no invoke<T>? (Noah Roberts)
7. Re: Problem with gcc/4.5.0-g++and boost::function
(Andreas Wehrmann)
----------------------------------------------------------------------
Message: 1
Date: Thu, 31 Mar 2011 20:21:29 +0200
From: Ovanes Markarian
AMDG
On 03/31/2011 09:55 AM, Panagiotis Foteinos wrote:
I looked into the documentation, but it is still unclear to me.
[...]
boost's locking mechanism
blocking or spinning?
It's an implementation detail. You realize that the two aren't necessarily mutually exclusive? Anyway, Boost.Thread does block on an Event. A spin-lock only makes sense on a multi-core system.
In Christ, Steven Watanabe
As Steven pointed out it is an implementation detail and these two concepts
might be used together (primarily for optimization). Switching to kernel
mode (e.g. dealing with kernel objects like event, mutex, semaphore through
system calls) is a very time costly operation, therefore some libs provide
spinning optimizations, which do spinning (for some few cpu cycles) and if
they are still unable to acquire a lock, they make a system call which
changes into the kernel mode and finally puts the thread into the blocked
state if the object is still not available (signaled, unlocked etc). But
even so it is not black and white in the concurrency world. :( Some would
like to achieve speed through such an optimization others would like to get
rid of such an optimization. A good example might be an embedded app running
on a battery driven HW, where energy plays a major role. Here wasting CPU
cycles for speed optimization might not be a good idea... But anyway that
should be separately evaluated.
With Kind Regards,
Ovanes
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Message: 2
Date: Thu, 31 Mar 2011 19:27:30 +0100
From: Robert Jones
AMDG
On 03/31/2011 08:29 AM, Robert Jones wrote:
From Bjorn Karlsson's book, P297...
int i; int value = 12; var(i) = ( if_then_else_return( _1>=10, constant(10),_1) )(value);
Why does the assignment LHS need to be wrapped in var()?
Because operator= must be a member function.
Nope, still not getting it! Stop me when I err...
if_then_else_return(...) defines a unary functor
it_then_else_return(...)( value) evaluates that functor, and returns what?
Some type of integer I think? So doesn't the assignment simply perform
assignment of an integer, by copy? And that doesn't need operator= to
a member of anything?
Thanks
- R.
-------------- next part --------------
HTML attachment scrubbed and removed
------------------------------
Message: 3
Date: Thu, 31 Mar 2011 11:38:33 -0700
From: Steven Watanabe
On Thu, Mar 31, 2011 at 4:47 PM, Steven Watanabe
wrote: On 03/31/2011 08:29 AM, Robert Jones wrote:
From Bjorn Karlsson's book, P297...
int i; int value = 12; var(i) = ( if_then_else_return( _1>=10, constant(10),_1) )(value);
Why does the assignment LHS need to be wrapped in var()?
Because operator= must be a member function.
Nope, still not getting it! Stop me when I err...
if_then_else_return(...) defines a unary functor it_then_else_return(...)( value) evaluates that functor, and returns what?
Some type of integer I think?
Yes.
So doesn't the assignment simply perform assignment of an integer, by copy? And that doesn't need operator= to a member of anything?
Oh, I see. As written, the code doesn't make much
sense, so my mind automatically translated it into
(var(i) = if_then_else_return( _1>=10, constant(10),_1) )(value);
In Christ,
Steven Watanabe
------------------------------
Message: 4
Date: Thu, 31 Mar 2011 22:56:11 +0000 (UTC)
From: archie14
AMDG
On 03/31/2011 09:27 AM, Shah, Gaurav N wrote:
I have legacy code in my library using boost::function. This works fine if I am using gcc/4.2.2-g++ and BOOST/1.41. But if I switch myself to using gcc/4.5.0-g++ and BOOST/1.44 I get below ERROR: I do not see anything wrong with code.
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:51: error: 'function' in namespace 'boost' does not name a type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:58: error: ISO C++ forbids declaration of 'parameter' with no type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:66: error: expected ',' or '...' before '<' token ../../../../../../marketdata/IMDMXP/server/wombat/management.cpp:126:10: error: prototype for 'void datasource::management::stop(const std::string&, const boost::function
&)' does not match any in class 'datasource::management' /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:14: error: candidate is: void datasource::management::stop(const std::string&, int) make[6]: *** [management.lo] Error 1 make[6]: *** Waiting for unfinished jobs.... Code lines throw ERROR:
68 */ 69 void stop(const std::string& topic, const boost::function< void (void)>& action); 70
Thanks for help in advance.
Have you verified that boost/function.hpp is #included?
In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
This is the first thing I would check, since the compiler has become stricter, meaning indirect inclusions won't work anymore. I ran across the same problem when upgrading from 4.2.x to 4.4.x and 4.5.x respectively. Regards, Andreas -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-K?ck-Stra?e 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com ------------------------------ _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users End of Boost-users Digest, Vol 2679, Issue 1 ******************************************** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries and affiliates. This transmission may contain information that is privileged, confidential, legally privileged, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by JPMorgan Chase & Co., its subsidiaries and affiliates, as applicable, for any loss or damage arising in any way from its use. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. Please refer to http://www.jpmorgan.com/pages/disclosures for disclosures relating to European legal entities.
AMDG On 04/01/2011 01:09 AM, Shah, Gaurav N wrote:
Thanks Andreas Wehrmann. if worked after including boost/function.hpp.
I am still wondering what changes boost has made while moving from 1.41 to 1.44 that has made users to explicitly include "function.hpp" This code was compiling with 1.41 without including boost/function.hpp
If it didn't #include boost/function.hpp, then it was incorrect to begin with. You can't depend on headers being implicitly included. It may happen to work, but we make no guarantees that it will continue to work in any future version. In Christ, Steven Watanabe
participants (2)
-
Shah, Gaurav N
-
Steven Watanabe