John Maddock | 3 Jul 10:36

is_base_of<int, int> behaviour.

Folks,

Some time ago we made is_base_of<int,int>::value true, for reasons that 
escape me, and the TR1 followed this.

However, C++0X makes is_base_of<non_class, non_class>::value to be false, 
which seems all round more logical to me.

While I'm sorting out what is_base_of<T, const T> does, it's a good time to 
fix this as well.  Are there any objections to changing the behaviour of 
is_base_of to match C++0X?

Cheers, John. 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Anand | 3 Jul 03:29

boost::spirit -- semantic values

I couldn't find a way to associate a semantic value with a
non-terminal. Bison/yacc allows this.

For example, here is a rule in Bison that says an expression can be
the sum of two subexpressions:

     expr: expr '+' expr   { $$ = $1 + $3; }
             ;

The action says how to produce the semantic value of the sum
expression from the values of the two subexpressions.

Having semantic values for non-terminals is useful to build an expression tree.

For, e.g, I can create a new node in the tree by passing in the
semantic values of child nodes in the action.
     expr: expr '+' expr   { $$ = makeNode($1, $3, "+"); }
             ;

In this case the semantic value for each expression is of type Node*.

Spirit provides parse trees and ASTs and also semantic actions that
take the first last iterator pair. But is there some way I can
associate a semantic value with each non-terminal  and pass in these
semantic values to the action for the rule.

Thanks,
Anand
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
(Continue reading)

k-oli | 2 Jul 06:51

Re: [task] 0.2.1 Doesn't compile on VC7.1 / older gcc

Hello Chard,

I do currently a rework/refactoring of the code - I'll take your points into 
account. I'll try to get test it with gcc3.4.4.

best regrds,
Oliver

Am Dienstag 30 Juni 2009 22:04:10 schrieb Chard:
> Hi Oli,
>
> As documented, you're testing MS compilation with VC9.  We're currently
> tied to VC7.1 and as we use a threadpool heavily (Philipp Henkel's) I have
> a particular interest in seeing an 'official' boost threadpool.  So forgive
> me if I keep these coming ;-)
>
> There is another VC7.1 compiler conformance issue:
>
> static_pool now has the contained pool_base class.  The pool_base::submit
> method constructs a handle<>, however, this has the VC7.1 'friend access to
> contained class' problem.
>
> The handle<> (non-default) constructor is private, granting friend access
> to static_pool, however, static_pool<>::pool_base requires access, and
> VC7.1 barfs.
>
> I couldn't figure out the friend syntax (that works) to add to class
> handle<>, so for now I'm working with handle<> (hacked as) public.
> (Note: earlier versions of gcc, e.g. 3.4.4, will exhibit this problem,
> too.)
(Continue reading)

k-oli | 2 Jul 06:50

Re: [task] 0.1 => 0.2.1 removes make_task

Hi Chard,

Am Dienstag 30 Juni 2009 22:13:53 schrieb Chard:
> Task version 0.1 => 0.2.1 comment.
> e.g. 0.1:
>
>     task::async(threadpool, task::make_task(TaskFunc));
>
> 0.2.1 (argument order exchanged in 0.2.1):
>
>     task::async(move(task::task<void>(TaskFunc)), threadpool);
>
> I assume the reasoning behind this was the cut-over to using move
> semantics; if this is the case then the constructor:

Yes - one reason was the introduction of move semantics as well as to provide 
a default execution-policy for async().

> explicit task( Fn fn, BOOST_ENUM_TASK_MAKE_TASK_FUNC_ARGS(n)) \
>
>  : task_( new detail::task_wrapper<       \
>
>    typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type, \
>    function< typename result_of< Fn( BOOST_PP_ENUM_PARAMS(n, A)) >::type()
> > \
>
>   >( bind( fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \
>
>  {}
>
(Continue reading)

Zachary Turner | 2 Jul 02:23

Units of data

Has anyone extended (even privately) Boost.Units to include support
for units of data (bits, bytes, KB, MB, etc)?  It seems like this
would be a useful addition to Boost.Units.

Assuming no, what is the minimum amount of work required to do this
myself?  There's not a lot of info in the docs on how to define new
base units, although I've already begun looking over the source code
to try to come up with something.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Sandeep Gupta | 2 Jul 01:19

[BGL] on using visitor in dijkstra_shortest_path

Hi,
 The example code for extending dijkstra  via gives compilation errors.
Attached below is the snippet code and the  error messages using gcc-4.3.3
and boost_138_0.

typedef boost::adjacency_list<vecS, vecS, bidirectionalS > graphImpl_t;

//----taken for doc---
template <class PredecessorMap>
class record_predecessors : public dijkstra_visitor<>
{
  public:
  record_predecessors(PredecessorMap p)
      : m_predecessor(p) { }

    template <class Edge, class Graph>
    void edge_relaxed(Edge e, Graph& g) {
      // set the parent of the target(e) to source(e)
      put(m_predecessor, target(e, g), source(e, g));
    }
  protected:
    PredecessorMap m_predecessor;
  };

template <class PredecessorMap>
record_predecessors<PredecessorMap> //error: expected constructor,
destructor, or type conversion before ‘<’ token
  make_predecessor_recorder(PredecessorMap p) {
    return record_predecessors<PredecessorMap>(p);
  }
(Continue reading)

Chard | 1 Jul 23:32

Messages lost

I made two posts to this group on 30 June, around 21:00 UTC.  Both received 
acknowledgements, but neither have appeared.  A post to the users group, 
made at about the same time, appeared there immediately.

New messages later than my posting time are appearing, so it doesn't look 
like it's back-log.

Are there any known problems?

Apologies if this should be directed elsewhere, but at the moment there 
doesn't seem to be a route open to www.boost.org (to find out); certainly 
from my ISP...sigh.

(Posting this one at 21:30 UTC) 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Soren Holstebroe | 1 Jul 22:07

Fixed point implicity

Hi,

I'm generalizing my fixed point class and have come across a few
design decisions.

1. Return type of additive arithmetic operation between integers and
fixed points

Example: a 16 bit integer is added to a 16 bit fixed point with 8 bit fraction.
I see three possible return types: 16 bit integer, 16:8 fixed point
and promoted 32:8 fixed point
If return type is 16 bit integer, the fraction is lost. Clearly not an option.
If return type is 16:8 fixed point overflow is possible.
A return type of 32:8 would eliminate overflow, but promotion quickly
becomes problematic for larger integer types, lets say a 32 bit
integer added to a fixed point. In that case we would need a 64 bit
integer which could cripple performance on many systems.
Another problem with promotion is that the arithmetic expression
typically would be in a context where the expression is assigned to a
fixed point of the type present in the expression. In that case we
have an overflow problem again.

I think I favor keeping the return type in 16:8. The user would then
have to use an explicit cast to avoid overflow.

2. Return type of additive arithmetic operation between float and fixed points

Example: fixed_point<int, 16>(10.5) + 5.5f  (integer is representing
type, 16 bit is the bit reserved for the fraction)
What would you expect the return type to be?
(Continue reading)

willem hengeveld | 1 Jul 10:02
Favicon

boost::interprocess - lnk2005 error due to compiler/linker bug in msvc8

when using boost::interprocess under win32, i ran into the following  
problem:
in boost/interprocess/detail/win32_api.hpp several static inline  
functions have a function local class
for releasing resources, like 'unlink_file', which defines 2 classes:
handle_closer, and auto_ptr

due to a compiler bug, as discussed here: http://www.eggheadcafe.com/conversation.aspx?messageid=32706692&threadid=32706692

you get a LNK2005 error  <symbol> already defined in <object>

when using boost::interprocess from multiple .cpp files

a solution is to use boost::shared_ptr instead of local classes in  
win32_api.hpp, like this:

   boost::shared_ptr<void> hiPSAPI =  
boost::shared_ptr<void>(load_library("PSAPI.DLL"), free_library);

attached is the complete patch

willem

Attachment (fixed-lnk2005.patch): application/octet-stream, 3866 bytes

_______________________________________________
(Continue reading)

Stewart, Robert | 30 Jun 23:00
Favicon

[xpressive] Performance Tuning?

I was experimenting with Xpressive to see how it would compare with some custom, string-based numeric
input parsing.  The Xpressive code is over 175X slower than the custom code.  Have I done anything to make it
really slow?  Can it be made faster?  I have included the Xpressive code and the performance testing code
below for your study.  Can you spot anything I've done wrong?

(BTW, I tried using Spirit.Qi for this -- with Boost 1.37 -- but never could get things to compile.  I gave up
and decided I'd wait until I can use a newer release before I fight that fight again. :-} )

FYI: bar::numeric_cast winds up calling strtod(), strtol(), etc.  It is semantically equivalent to lexical_cast.

#include <boost/xpressive/xpressive_static.hpp>
#include <boost/xpressive/regex_actions.hpp>

namespace foo
{
   namespace op
   {
      template <class T>
      struct numeric_cast
      {
         typedef T result_type;

         template <class Value>
         T
         operator ()(Value const & _value) const
         {
            return bar::numeric_cast<T>(_value);
         }
      };
   }
(Continue reading)

manmohan.m | 30 Jun 15:24

[interprocess] problem compiling

Hello,
         I'm trying to use boost::interprocess in my code. The environment being used is S60 armv5 WINSCW (RVCT
compiler) . Since it's a header only library, I presumed including it in my USERINCLUDE (i.e placing
interprocess inside my local \inc), would suffice the purpose. But there were some dependencies e.g.
some include files were not to be found. I managed to solve the interdependencies by including the missing
files locally. But when I try to use the sample code for managed_shared_memory (given on the doc page for
boost::interprocess), it's giving me errors regarding template-instantiation in
..\inc\boost\interprocess\mem_algo\rbtree_best_fit.hpp. To be precise, the error that I got is
attached in the text file. It's too verbose to be written here. The usage is that my main() consists of the following

#include "boost/interprocess/managed_shared_memory.hpp"
#include "boost/interprocess/containers/vector.hpp"
#include "boost/interprocess/allocators/allocator.hpp"

int main ()
{
      using namespace boost::interprocess;
     //Shared memory front-end that is able to construct objects
      //associated with a c-string. Erase previous shared memory with the name
      //to be used and create the memory segment at the specified address and initialize resources
      shared_memory_object::remove("MySharedMemory");
      managed_shared_memory segment (create_only ,"MySharedMemory" ,65536);          //segment size in bytes
        return 0;
}

        The underlined statement is the point of instatiation and this is creating the above said errror. Could
somebody please point out what am I missing? Is there something else that I need to do in order to use boost::interprocess?

Thanks & Regards
Manmohan
(Continue reading)


Gmane