Boost logo

Boost Users :

From: Olatunde Adonai (oadonai_at_[hidden])
Date: 2006-05-11 10:57:56


The following code compiles with f as a uint32_t. It does not compile with f as
a uint64_t. Why is this? What can be done?

#include <iostream>
#include <algorithm>
#include <boost/lambda/lambda.hpp>

using std::cout;
using std::for_each;
using namespace boost::lambda;

int main(int argc, const char* argv[])
{
  const char s[] = "abcdefghi";

  //Problem:
  uint64_t f = 0xaa; //This compiles as a uint32_t.
  unsigned int i = 0;

  for_each(s
           , &s[sizeof(s) - 1]
           , cout << _1 << " = " << var(i)++ << " ("
             << ( ( f >> var(i) ) & 1 ) << ")\n"
           );
  return 0;
}

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


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