|
Boost Users : |
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2007-12-05 09:00:17
boost-users-bounces_at_[hidden], le 4 décembre 2007 22:46:
> int main(int argc, char **argv){
> typedef CRefPtr<CNode> CPNode;
> typedef std::multimap<std::string, CPNode> TPNodes; TPNodes
> Children; std::for_each(
> Children.begin(),
> Children.end(),
> boost::bind(
> &CNode::GetName,
> // problem in the next line
> boost::bind(&TPNodes::value_type::second,_1)));
> return 0;
> }
>
> I get the following messages from MSVC8.0:
> error C2784: 'T *boost::get_pointer(const boost::shared_ptr<T> &)' :
> could not deduce template argument for 'const boost::shared_ptr<T> &'
> from 'const CPNode' error C2784: 'T *boost::get_pointer(const
> std::auto_ptr<_Ty> &)' : could not deduce template argument for
> 'const std::auto_ptr<_Ty> &' from 'const CPNode' error C2784: 'T
> *boost::get_pointer(T *)' : could not deduce template argument for 'T
> *' from 'const CPNode'
>
> If I replace CRefPtr with boost::shared_ptr the code compiles.
Hi
You probably need boost::get_pointer: http://lists.boost.org/boost-users/2007/09/30745.php
HTH,
Éric Malenfant
---------------------------------------------
Si vous n'allez jamais à l'enterrement des gens, n'espérez pas qu'ils viennent au vôtre.
- C. Lemprun
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net