Checking if a string is a number with STL
I had to really look at your code and think about what it was doing before I figured it out.  That tells me that this code is not elegant by my definition of "elegant".  My definition of elegant is something like,


  Easy to understand, easy to maintain, efficient in execution, robust.


I would suggest something like this as a start:

if( m.empty() )
  return false;

string::iterator start = m.begin();
if( *start == '-' )
  ++start;

if( m.end() == find_if( start, m_end(), not1(ptr_fun(isdigit)) ))
  return true;
else
  return false;


Not much caring for the use of find_if, I'd refine it to:

if( m.empty() )
  return false;

string::size_type pos = 0;
if( m[0] == '-' )
  pos = 1;

if( m.find_first_not_of("0123456789", pos) == m.end() )
  return true;
else
  return false;


I find this to be much more elegant than the 1-liner you wrote.  It's more code, sure.  But it is exceedingly simple to understand and maintain.  You found a bug yourself just by brain-compiling it.  That's what code should look like.