Here is the smallest code I could come up with to reproduce the
Quote:
behavior:
>
#include <vector>
#include <functional>
#include <boost/function.hpp>
>
template< class T >
void test()
{
typedef std::vector< T TItems;
typedef boost::function< bool (T, T) TCompFn;
typedef std::vector< std::size_t TSizes;
>
TItems data;
TCompFn fn = TCompFn( std::greater< T >() );
fn( data.front(), data.front() ); // NOTE: data is empty - will
cause a runtime error if run
>
}
>
int main()
{
test< int >();
test< unsigned >();
>
}
>
I was able to reproduce the warning with an even smaller snippet of
code:
#include <vector>
#include <functional>
#include <boost/function.hpp>
int main()
{
std::vector< std::size_t sizes;
std::vector< unsigned data;
boost::function< bool (unsigned, unsigned) fn = std::greater<
unsigned >();
fn( data.front(), 10 );
}
The warning goes away if I comment out the line "std::vector<
std::size_t sizes;". This behavior baffles me. Any insight would
again be appreciated.
Thanks,
Matt