Boost logo

Boost Users :

Subject: Re: [Boost-users] filesystem path constructor fails when passing in std::string (Visual studio project)
From: Sillence, Martin (GE Oil & Gas) (Martin.Sillence_at_[hidden])
Date: 2012-03-15 13:54:41


> The simple code:
> std::string str("d:\\New folder");
> bfs::path base(str);

> Is causing an illegal memory access giving the following stack trace:

>
msvcp90d.dll!std::basic_string<char,std::char_traits<char>,std::_DebugHe
apAllocator<char> >::assign(const
std::basic_string<char,std::char_traits<char>,std::_DebugHeapAllocator<c
har> > & _Right="*") Line 1052 C++
>
msvcp90d.dll!std::basic_string<char,std::char_traits<char>,std::_DebugHe
apAllocator<char> >::operator=(const
std::basic_string<char,std::char_traits<char>,std::_DebugHeapAllocator<c
har> > & _Right="*") Line 927 C++

OK I guess a bit too trigger happy with this post.

I was retesting and release works but debug doesn't...

I'm guessing this is due to the fact we have iterator optimisation for
release and not for debug e.g. _HAS_ITERATOR_DEBUGGING=0
For some reason debug is linking or pulling in the release library of
boost, now I know that I guess it's as good as solved.

Sorry for the post, hope it proves useful to someone in future.

Regards,
M


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