Hi list:
I am in the process of using boost::algorithm::replace_all with the following tuple:
Boost::tuple<DWORD, boost::filesystem::wpath>
If I use the code below:
                std::wstring temp1, temp2, temp3;
temp1 =ProcInfo.get<1>().string();
temp2 =ProcInfo.get<1>().filename();
temp3 =L"dolapi.dll";
boost::algorithm::replace_all(temp1, temp2, temp3);
The code compiles fine, How ever if I use:
boost::algorithm::replace_all(ProcInfo.get<1>().string(), ProcInfo.get<1>().filename(), L"dolapi.dll");
Compiling...
TPProductsSR.cpp
c:\program files\boost\boost\algorithm\string\detail\find_format_all.hpp(250) : error C2664: 'boost::algorithm::detail::erase' : cannot convert parameter 2 from 'input_iterator_type' to 'std::_String_iterator<_Elem,_Traits,_Alloc>'

        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits,
            _Alloc=std::allocator
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

        c:\program files\boost\boost\algorithm\string\detail\find_format_all.hpp(185) : see reference to function template instantiation 'void boost::algorithm::detail::find_format_all_impl2<INPUTT,FINDERT,FORMATTERT,FINDRESULTT,BOOST::ITERATOR_RANGE>(InputT &,FinderT,FormatterT,FindResultT,FormatResultT)' being compiled

        with
        [
            InputT=const std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            FinderT=boost::algorithm::detail::first_finderF<STD::_STRING_CONST_ITERATOR<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,boost::algorithm::is_equal>,

            FormatterT=boost::algorithm::detail::const_formatF<BOOST::ITERATOR_RANGE>,
            FindResultT=boost::iterator_range<STD::_STRING_CONST_ITERATOR<WCHAR_T,STD::CHAR_TRAITS,std::allocator>>,
            IteratorT=const wchar_t *,
            FormatResultT=boost::iterator_range
        ]
        c:\program files\boost\boost\algorithm\string\find_format.hpp(254) : see reference to function template instantiation 'void boost::algorithm::detail::find_format_all_impl<SEQUENCET,FINDERT,FORMATTERT,BOOST::ITERATOR_RANGE>(InputT &,FinderT,FormatterT,FindResultT)' being compiled

        with
        [
            SequenceT=const std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            FinderT=boost::algorithm::detail::first_finderF<STD::_STRING_CONST_ITERATOR<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,boost::algorithm::is_equal>,

            FormatterT=boost::algorithm::detail::const_formatF<BOOST::ITERATOR_RANGE>,
            IteratorT=std::_String_const_iterator<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            InputT=const std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            FindResultT=boost::iterator_range<STD::_STRING_CONST_ITERATOR<WCHAR_T,STD::CHAR_TRAITS,std::allocator>>
        ]
        c:\program files\boost\boost\algorithm\string\replace.hpp(657) : see reference to function template instantiation 'void boost::algorithm::find_format_all<SEQUENCET,BOOST::ALGORITHM::DETAIL::FIRST_FINDERF,boost::algorithm::detail::const_formatF>(SequenceT &,FinderT,FormatterT)' being compiled

        with
        [
            SequenceT=const std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            SearchIteratorT=std::_String_const_iterator<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            PredicateT=boost::algorithm::is_equal,
            RangeT=boost::iterator_range,
            FinderT=boost::algorithm::detail::first_finderF<STD::_STRING_CONST_ITERATOR<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,boost::algorithm::is_equal>,

            FormatterT=boost::algorithm::detail::const_formatF<BOOST::ITERATOR_RANGE>
        ]
        d:\work\access for everyone\ghg\tpproductssr\tpproductssr.cpp(41) : see reference to function template instantiation 'void boost::algorithm::replace_all,std::basic_string<_Elem,_Traits,_Ax>,const wchar_t[11]>(SequenceT &,const Range1T &,Range2T (&))' being compiled

        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits,
            _Ax=std::allocator,
            SequenceT=const std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            Range1T=std::basic_string<WCHAR_T,STD::CHAR_TRAITS,std::allocator>,
            Range2T=const wchar_t [11]
        ]
c:\program files\boost\boost\algorithm\string\detail\find_format_all.hpp(255) : error C2664: 'boost::algorithm::detail::insert' : cannot convert parameter 2 from 'std::_String_const_iterator<_Elem,_Traits,_Alloc>' to 'std::_String_iterator<_Elem,_Traits,_Alloc>'

        with
        [
            _Elem=wchar_t,
            _Traits=std::char_traits,
            _Alloc=std::allocator
        ]
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called       
Using visual c++ 2008 on a windows xp box, not that this (the o/s at least) matters.

How can I avoid creating temporary variables in this case?
Any help appreciated.
Sean.
 

__________ Information from ESET NOD32 Antivirus, version of virus signature database 4061 (20090507) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com