Boost logo

Boost Users :

Subject: [Boost-users] General: <unresolved overloaded function type>
From: Etienne Philip Pretorius (icewolfhunter_at_[hidden])
Date: 2009-07-28 13:06:16


Hello List,

Just a general question:

I am trying to use boost::asio::async_read_until with a these templated
functions:

template<typename D>
struct entity {
template<typename T>
std::pair<T,bool> operator()(
T begin,
T end
) {
if(begin == end) {
return std::make_pair<end,false>;
}
return static_cast<D*>(this)->impl(begin,end);
};
};

/* http://www.w3.org/TR/REC-xml/#NT-S */
struct white_space
: entity<white_space> {
template<typename T>
std::pair<T,bool> impl(
T begin,
T end
) {
for(; begin != end; begin++) {
if(*begin == 0x09u || *begin == 0x0Au ||
*begin == 0x0Du || *begin == 0x20u) {
continue;
}else{
return std::make_pair<begin,false>;
}
}
return std::make_pair<end,true>;
};
};

I get the following error:
xml.hpp:146: error: conversion from ‘<unresolved overloaded function
type>’ to non-scalar type
‘std::pair<boost::asio::buffers_iterator<boost::asio::const_buffers_1,
char>, bool>’ requested

At every line that I have a return defined...

Could someone please explain to me what I have done wrong here....

Thank you,
Etienne


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