public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* mybit.to_ulong()
@ 2011-08-02  5:39 eric
  0 siblings, 0 replies; only message in thread
From: eric @ 2011-08-02  5:39 UTC (permalink / raw)
  To: dave; +Cc: gcc-help

Dear John:

  I read the email gcc4.7 test
  it seem to_ulong() is failed, that you post in July 9, this year,
tested in hppa64-hp-hpux11.11, 
=== g++ tests ===
FAIL: 23_containers/bitset/to_ulong/1.cc execution test

in
http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg01038.html

  is that be fixed?(at least in 4.7)

  I am using 4.5.2
  do I have someway to get around it?

my exactly program is following
------------------------------
#include "big_int.hpp"

#include <iostream>
#include <vector>
#include <iterator>
#include <algorithm>

using namespace std;
   

void outputBigInt(BigInt<1024> x) {
  vector<int> v;
  if (x == 0) {
    cout << 0;
    return;
  }
  while (x > 0) {
    v.push_back((x % 10).to_ulong());
    x /= 10;
  }
  copy(v.rbegin(), v.rend(), ostream_iterator<int>(cout, ""));
  cout << endl;
}

int main() {
  BigInt<1024> n(1);
  // compute 32 factorial
  for (int i=1; i <= 32; ++i) {
    n *= i;
  }
  outputBigInt(n);
}
----------------------------------------------------------------
this is from book (c++ cookbook, example 11-39)
-------I get g++ compile error---------------
root@eric-laptop:/home/eric/cppcookbook/ch11# g++ Example11-39.cpp
Example11-39.cpp: In function ‘void outputBigInt(BigInt<1024u>)’:
Example11-39.cpp:19:26: error: ‘class BigInt<1024u>::self’ has no member
named ‘to_ulong’
------------------------------------------------------------------
plz help, Thanks a lot in advance, Eric

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-02  5:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-02  5:39 mybit.to_ulong() eric

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).