Joel de Guzman | 1 Feb 01:45
Picon
Favicon

Re: Relationship of Lambda and Phoenix

Scott Meyers wrote:
> At BoostCon 2007, I was told that the functionality of Boost.Lambda was 
> essentially present via Phoenix in Boost.Spirit.  From what I can tell, both 
> Lambda and Spirit/Phoenix will be present in 1.35, leading me to wonder what 
> advice to give people who are interested in experimenting with the use of lambda 
> functions in Boost.  Are people to be encouraged to use Phoenix over Lambda, or 
> are there features in Lambda that Phoenix doesn't have?
> 
> I'll be giving an overview of some Boost libraries at the Software Development 
> conference in March, and I'll be showing some examples of Lambda.  If I should 
> be telling people to use Phoenix for future work, I'd like to know that.

It's interesting to note that Dave asked me a similar question:
"If I were going to teach practical functional programming in C++, should
I teach people Boost.Phoenix instead of Boost.Lambda?  If so, why? "

Here's my answer. It seems that it should answer yours? :

In the context of Boost, I'd say it's better to teach Lambda as
it is the official Boost library. Phoenix has some additional features
beyond Lambda's so perhaps a short delve into those, in the context
of the pending merger, will be good. All of current Lambda's API and
all tests will be assimilated in the merger, so there's no fear that
something will go away and be obsolete.

Here's a short list of features in phoenix beyond lambda:

* Lazy Functions (http://tinyurl.com/yvjo7p) makes it easy to
   adapt bindable polymorphic function objects. This, IMO, is
   crucial in writing extensive generic lazy function libraries.
(Continue reading)

Scott Meyers | 1 Feb 02:13
Favicon

Re: Relationship of Lambda and Phoenix

Joel de Guzman wrote:

> Does that help?

A whole lot, thanks very much!

Scott
David Abrahams | 1 Feb 05:02
Picon
Picon
Favicon
Gravatar

Re: boost python: linking with pythonxx_d.lib


on Tue Dec 11 2007, "Christian Hoffmann" <chrmhoffmann-AT-gmail.com> wrote:

> Hi,
>
> I tried to compile boost python so that it links against the debug version. I
> therefore run
>
> bjam toolset=msvc-9.0  threading=multi python-debugging=on link=shared variant=
> debug libs\python\build
>
> Running it with -n shows, that it sets -DBOOST_DEBUG_PYTHON, but it still links
> with python25.lib.
>
> It only picks "right" python25_d.lib, if I add something to my user-config.jam,
> like the following:
>
> using python : 2.5 : C:\\src\\Python-2.5\\PCBuild\\python ; using python : 2.5
> : C:\\src\\Python- 2.5\\PCBuild\\python_d
>   : # includes
>   : # libs
>   : <python-debugging>on ;
>
> What is the difference between the two methods (as a bjam argument and in the
> user-config.jam), and is there a way to combine both on the command
> line?

They're not separate methods.  The user-config.jam entry is necessary
because Boost.Build's auto-configuration for Python doesn't look for
debug builds of Python.  Even if you add that entry, if (as above) it
(Continue reading)

David Abrahams | 1 Feb 05:12
Picon
Picon
Favicon
Gravatar

Re: How to expose self defined type in boost.python


on Mon Jan 14 2008, "Huang You Gong" <huangyougong-AT-gmail.com> wrote:

> Hi,
>  
> I try to use boost.python to invoke C++ library in Python, so I need to expose
> types and classes.
> Here is the c++ head file:
>  
> typedef int XTYPE;
> class XCLASS
> {
> public:
>         XTYPE getvalue( void ){ return XTYPE( 3 ); }
> };
>        
> So I write exposing code in BOOST_PYTHON_MODULE like this:
>  
> BOOST_PYTHON_MODULE( x )
> {
>         class_< XCLASS >( "XCLASS" )
>                 .def( "getvalue", &XCLASS::getvalue, return_value_policy<
> copy_non_const_reference >() )
>         ;
> }
>  
> but there is compiling error as using of undefined type.

The return_value_policy is wrong.  The type returned by getvalue is not
a reference type.
(Continue reading)

Prashant Gupta | 1 Feb 04:39
Picon

replacement of CAtlREMatchContext

I am trying to port the following VC8 code to boost. I need to know what are the equivalent methods in boost:: namespace for the following:
1) m_nNumGroups data memeber of class CAtlREMatchContext
2) GetMatch( ) method of class CAtlREMatchContext
 
I have gone through the boost documentation but could not suceed.
 
            for (UInt32 ulGroupIndex = 0; ulGroupIndex < atlMatchContext.m_uNumGroups; ++ulGroupIndex)
            {
                const CAtlREMatchContext<>::RECHAR* pszStart = 0;
                const CAtlREMatchContext<>::RECHAR* pszEnd = 0;
                atlMatchContext.GetMatch(ulGroupIndex, &pszStart, &pszEnd);
                int nLength = static_cast<int>(pszEnd - pszStart);
                strTemp = pszStart;
                strTemp = strTemp.substr(nLength);
                AcMs::trimString(strTemp, true, true);
                switch(ulGroupIndex)
                {
                case MsV7ImgMgrImgIndexType::kViewNo:
_______________________________________________
Boost-users mailing list
Boost-users <at> lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
Renato Golin | 1 Feb 10:25
Picon
Picon
Favicon

Boost MPI


Hiya,

I've heard that MPI was accepted and reviewed, but I can't find it in my
regular Boost distribution (ubuntu) nor in the web site.

If this is the specification, I'm SO looking forward to use it.

http://www.osl.iu.edu/~dgregor/boost.mpi/doc/

Do you have any ideas when / if this is going to be finally approved and
distributed with Boost?

cheers,
--renato

--

-- 
Reclaim your digital rights, eliminate DRM, learn more at
http://www.defectivebydesign.org/what_is_drm
Robert Bielik | 1 Feb 10:57
Picon

[serialization] Cannot increase version of stored objects

I need to update the version certain objects in my structure, but I cannot get the version
number incremented.

Scenario:

I have a class MyClass which have several entries of InternalClass objects (which is the one
I want a new version of):

class MyClass
{
    ...
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
       ar & BOOST_SERIALIZATION("MyInternals", m_vector_of_internal_class_objects);
    }

    std::vector<InternalClass> m_vector_of_internal_class_objects;

    class InternalClass
    {
       template<class Archive>
       void save(Archive & ar, const unsigned int version) const
       {
          ar & BOOST_SERIALIZATION("data", m_data);
       }

       template<class Archive>
       void load(Archive & ar, const unsigned int version)
       {
          if (version == 0)
          {
             old_data_t tmp;
             ar & BOOST_SERIALIZATION("data", tmp);
             m_data = convertToNewData(tmp);
          }
          else
          {
             BOOST_CHECK(version == 1);
             ar & BOOST_SERIALIZATION("data", m_data);
          }
       }
       BOOST_SERIALIZATION_SPLIT_MEMBER()

       new_data_t m_data;
    }
}

Then in the body (.cpp) I define:

BOOST_CLASS_VERSION(MyClass::InternalClass, boost::serialization::object_class_info)
BOOST_CLASS_VERSION(MyClass::InternalClass, 1)

But when saving to the XML archive file, I still get version="0" for the InternalClass objects (?)

/R
John Phillips | 1 Feb 15:06
Picon

Re: Boost MPI

Renato Golin wrote:
> Hiya,
> 
> I've heard that MPI was accepted and reviewed, but I can't find it in my
> regular Boost distribution (ubuntu) nor in the web site.
> 
> If this is the specification, I'm SO looking forward to use it.
> 
> http://www.osl.iu.edu/~dgregor/boost.mpi/doc/
> 
> Do you have any ideas when / if this is going to be finally approved and
> distributed with Boost?
> 
> cheers,
> --renato
> 

   Renato,
   It was reviewed and accepted, and it is in the Subversion repository. 
If you want to wait for 1.35, it will be included. If not, you can get 
it from the repository as part of the boost files.

			John Phillips
Ioannis Nousias | 1 Feb 15:15
Picon
Picon

Re: BGL: return all shortest paths between two vertices

Thanks James. That would be nice

cheers,
Ioannis

James Jackson wrote:
> OK, thanks. I have implemented (although not with the BGL for  
> simplicity) a modified Dijkstra's algorithm which returns all shortest  
> paths (a rather simpler problem that that of the K shortest paths, as  
> suggested in the link). I will try and find time to port this as a BLG  
> algorithm and make it available.
>
> Regards,
> James.
>
> On 31 Jan 2008, at 12:36, Aaron Windsor wrote:
>
>   
>> On Jan 30, 2008 11:25 AM, James Jackson <james.jackson <at> cern.ch> wrote:
>>     
>>> I have a subquestion... Is there an algorithm that will return all
>>> shortest paths between two vertices? (I.e. like Djikstra's algorithm
>>> but returning all, not just one, shortest path should such a  
>>> condition
>>> exist).
>>>
>>>       
>> Hi James,
>>
>> See this message from the boost users list a few years ago:
>>
>> http://lists.boost.org/boost-users/2005/09/13987.php
>>
>> Regards,
>> Aaron
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users <at> lists.boost.org
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>>     
>
> _______________________________________________
> Boost-users mailing list
> Boost-users <at> lists.boost.org
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>   
Renato Golin | 1 Feb 15:18
Picon
Picon
Favicon

Re: Boost MPI

John Phillips wrote:
>    Renato,
>    It was reviewed and accepted, and it is in the Subversion repository. 
> If you want to wait for 1.35, it will be included. If not, you can get 
> it from the repository as part of the boost files.

Hey, that's great news! Any prediction when 1.35 will be available?

cheers,
--renato

Gmane