C++ 升压错误';只读位置的分配';和';没有用于调用的匹配函数';(新安装)

C++ 升压错误';只读位置的分配';和';没有用于调用的匹配函数';(新安装),c++,boost,include,C++,Boost,Include,我只是在试用Boost库,但遇到了一个错误 代码很简单: #include <string> #include <iostream> #include "/usr/include/boost/algorithm/string.hpp"; #include "/usr/include/boost/algorithm/string/erase.hpp"; using namespace std; using namespace boost; using namespac

我只是在试用Boost库,但遇到了一个错误

代码很简单:

#include <string>
#include <iostream>  
#include "/usr/include/boost/algorithm/string.hpp";
#include "/usr/include/boost/algorithm/string/erase.hpp";

using namespace std;
using namespace boost;
using namespace boost::algorithm;
using namespace boost::string;


int main()
{
    erase_all(" ","the quick brown fox");
    return 1;
}

我在Boost网站上尝试了一个简单的Boost示例,效果很好,但是尽管做了大量的修改和搜索,我还是不明白为什么这个erase_all函数不起作用。 我有一种感觉,这是一个缺少的包括,但我不知道是哪一个

有人能解释一下吗

完整错误输出为:

test1.cpp:3:51: warning: extra tokens at end of #include directive
/usr/include/boost/algorithm/string/detail/find_format_all.hpp: In function âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â:
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:249: error: no matching function for call to âerase(const char [2], const char*&, const char*)â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:254: error: no matching function for call to âinsert(const char [2], const char*, std::_Deque_iterator<char, char&, char*>, std::_Deque_iterator<char, char&, char*>)â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp: In member function âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â:
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:98: error: assignment of read-only location
/usr/include/boost/algorithm/string/detail/replace_storage.hpp: In function âOutputIteratorT boost::algorithm::detail::move_from_storage(StorageT&, OutputIteratorT, OutputIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, OutputIteratorT = const char*]â:
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:70:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:35: error: assignment of read-only location
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h: In function â_OI std::__copy_aux(_II, _II, _OI) [with _II = const char*, _OI = const char*]â:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:326:   instantiated from âstatic _OI std::__copy_normal<<anonymous>, <anonymous> >::copy_n(_II, _II, _OI) [with _II = const char*, _OI = const char*, bool <anonymous> = false, bool <anonymous> = false]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:387:   instantiated from â_OutputIterator std::copy(_InputIterator, _InputIterator, _OutputIterator) [with _InputIterator = const char*, _OutputIterator = const char*]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:87:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:317: error: no matching function for call to âstd::__copy<true, std::random_access_iterator_tag>::copy(const char*&, const char*&, const char*&)â
test1.cpp:3:51:警告:#include指令末尾的额外令牌
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:在函数中–void boost::algorithm::detail::find_format_all_impl2(input&,FinderT,FormatterT,findresult,formatresult)[with input=const char 2],FinderT=boost::algorithm::detail::first\u finderF,formatter=boost::algorithm::detail::empty\u formatF,FindResultT=boost::iterator\u range,FormatResultT=boost::algorithm::detail::empty\u container]
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:实例化自–void boost::algorithm::detail::find_format_all_impl(input&,FinderT,FormatterT,findresult)[with input=const char 2],FinderT=boost::algorithm::detail::first\u finderF,FormatterT=boost::algorithm::detail::empty\u formatF,FindResultT=boost::iterator\u range]
/usr/include/boost/algorithm/string/find_format.hpp:247:实例化自–void boost::algorithm::find_format_all(SequenceT&,FinderT,formatter)[with SequenceT=const char[2],FinderT=boost::algorithm::detail::first_finderF,formatter=boost::algorithm::algorithm::detail::empty\u formatF]
/usr/include/boost/algorithm/string/erase.hpp:588:实例化自–void boost::algorithm::erase_all(SequenceT&,const range&)[其中SequenceT=const char[2],range=char[20]]
test1.cpp:12:从此处实例化
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:249:错误:没有匹配的函数用于调用–erase(const char[2],const char*&,const char*)函数
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:实例化自–void boost::algorithm::detail::find_format_all_impl(input&,FinderT,FormatterT,findresult)[with input=const char 2],FinderT=boost::algorithm::detail::first\u finderF,FormatterT=boost::algorithm::detail::empty\u formatF,FindResultT=boost::iterator\u range]
/usr/include/boost/algorithm/string/find_format.hpp:247:实例化自–void boost::algorithm::find_format_all(SequenceT&,FinderT,formatter)[with SequenceT=const char[2],FinderT=boost::algorithm::detail::first_finderF,formatter=boost::algorithm::algorithm::detail::empty\u formatF]
/usr/include/boost/algorithm/string/erase.hpp:588:实例化自–void boost::algorithm::erase_all(SequenceT&,const range&)[其中SequenceT=const char[2],range=char[20]]
test1.cpp:12:从此处实例化
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:254:错误:调用–insert(const char[2],const char*,std::_Deque_iterator,std:_Deque_iterator)时没有匹配的函数
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:In member function–ForwardIteratorT boost::algorithm::detail::process_segment\u helper::operator(),ForwardIteratorT=const char*,bool HasStableIterators=false]
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:实例化自–forwarditerator boost::algorithm::detail::process_段(StorageT&,input&,forwarditerator,forwarditerator,forwarditerator)[with StorageT=std::deque,input=const char[2],forwarditerator=const char*]
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:从–void boost::algorithm::detail::find_format_all_impl2实例化(input&,FinderT,FormatterT,findresult,formatresult)[with input=const char 2],FinderT=boost::algorithm::detail::first\u finderF,formatter=boost::algorithm::detail::empty\u formatF,FindResultT=boost::iterator\u range,FormatResultT=boost::algorithm::detail::empty\u container]
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:实例化自–void boost::algorithm::detail::find_format_all_impl(input&,FinderT,FormatterT,findresult)[with input=const char 2],FinderT=boost::algorithm::detail::first\u finderF,FormatterT=boost::algorithm::detail::empty\u formatF,FindResultT=boost::iterator\u range]
/usr/include/boost/algorithm/string/find_format.hpp:247:实例化自–void boost::algorithm::find_format_all(SequenceT&,FinderT,formatter)[with SequenceT=const char[2],FinderT=boost::algorithm::detail::first_finderF,formatter=boost::algorithm::algorithm::detail::empty\u formatF]
/usr/include/boost/algorithm/string/erase.hpp:588:实例化自–void boost::algorithm::erase_all(SequenceT&,const range&)[其中SequenceT=const char[2],range=char[20]]
test1.cpp:12:从此处实例化
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:98:错误:分配只读位置
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:In函数–OutputIteratorT boost::algorithm::detail::move_from_storage(StorageT&,OutputIteratorT,OutputIteratorT)[with StorageT=std::deque,OutputIteratorT=const char*]
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:70:实例化自–forwarditerator boost::algorithm::detail::process_segment\u helper::operator()(StorageT&,input&,forwarditerator,forwarditerator,forwarditerator,forwarditerator)[with StorageT=std::deque,input=const char[2],ForwardIterator=const char*,bool HasStableIterators=false]
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:从–ForwardIteratorT boost::algorithm::detail实例化
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:98: error: assignment of read-only location
test1.cpp:3:51: warning: extra tokens at end of #include directive
/usr/include/boost/algorithm/string/detail/find_format_all.hpp: In function âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â:
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:249: error: no matching function for call to âerase(const char [2], const char*&, const char*)â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:254: error: no matching function for call to âinsert(const char [2], const char*, std::_Deque_iterator<char, char&, char*>, std::_Deque_iterator<char, char&, char*>)â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp: In member function âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â:
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:98: error: assignment of read-only location
/usr/include/boost/algorithm/string/detail/replace_storage.hpp: In function âOutputIteratorT boost::algorithm::detail::move_from_storage(StorageT&, OutputIteratorT, OutputIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, OutputIteratorT = const char*]â:
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:70:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:35: error: assignment of read-only location
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h: In function â_OI std::__copy_aux(_II, _II, _OI) [with _II = const char*, _OI = const char*]â:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:326:   instantiated from âstatic _OI std::__copy_normal<<anonymous>, <anonymous> >::copy_n(_II, _II, _OI) [with _II = const char*, _OI = const char*, bool <anonymous> = false, bool <anonymous> = false]â
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:387:   instantiated from â_OutputIterator std::copy(_InputIterator, _InputIterator, _OutputIterator) [with _InputIterator = const char*, _OutputIterator = const char*]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:87:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment_helper<HasStableIterators>::operator()(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*, bool HasStableIterators = false]â
/usr/include/boost/algorithm/string/detail/replace_storage.hpp:150:   instantiated from âForwardIteratorT boost::algorithm::detail::process_segment(StorageT&, InputT&, ForwardIteratorT, ForwardIteratorT, ForwardIteratorT) [with StorageT = std::deque<char, std::allocator<char> >, InputT = const char [2], ForwardIteratorT = const char*]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:221:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl2(InputT&, FinderT, FormatterT, FindResultT, FormatResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>, FormatResultT = boost::algorithm::detail::empty_container<char>]â
/usr/include/boost/algorithm/string/detail/find_format_all.hpp:179:   instantiated from âvoid boost::algorithm::detail::find_format_all_impl(InputT&, FinderT, FormatterT, FindResultT) [with InputT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>, FindResultT = boost::iterator_range<const char*>]â
/usr/include/boost/algorithm/string/find_format.hpp:247:   instantiated from âvoid boost::algorithm::find_format_all(SequenceT&, FinderT, FormatterT) [with SequenceT = const char [2], FinderT = boost::algorithm::detail::first_finderF<const char*, boost::algorithm::is_equal>, FormatterT = boost::algorithm::detail::empty_formatF<char>]â
/usr/include/boost/algorithm/string/erase.hpp:588:   instantiated from âvoid boost::algorithm::erase_all(SequenceT&, const RangeT&) [with SequenceT = const char [2], RangeT = char [20]]â
test1.cpp:12:   instantiated from here
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:317: error: no matching function for call to âstd::__copy<true, std::random_access_iterator_tag>::copy(const char*&, const char*&, const char*&)â
int main()
{
    erase_all(" ","the quick brown fox");
    return 1;
}
int main()
{
    char s[] = "the quick brown fox";

    erase_all(s, " ");
    return 0;
}
std::string input("The quick brown fox");
boost::erase_all(input, " " );
std::cout << input << std::endl; // hopefully prints Thequickbrownfox