The Latest

2008-03-26 Thread band

As we record our next Album, go to

http://www.splitbelly.com

Grab our previous full length Album.. Absolutly FREE!

Nothing to fill out, no strings attached!
We also have a myspace page http://www.myspace.com/splitbelly

You may have seen our site was down for a few days as we hooked up with a new 
hosting company to save some cash.

http://www.maculahosting.com

These guys gave us a sweet deal.

Stay tuned and See ya later!

Brad Tratzinski
Splitbelly - Drummer

if you feel you got this email as a mistake please reply to this message with 
the word 'remove' as the subject.
We will remove you from the mailing list.



The Latest

2008-03-26 Thread band

As we record our next Album, go to

http://www.splitbelly.com

Grab our previous full length Album.. Absolutly FREE!

Nothing to fill out, no strings attached!
We also have a myspace page http://www.myspace.com/splitbelly

You may have seen our site was down for a few days as we hooked up with a new 
hosting company to save some cash.

http://www.maculahosting.com

These guys gave us a sweet deal.

Stay tuned and See ya later!

Brad Tratzinski
Splitbelly - Drummer

if you feel you got this email as a mistake please reply to this message with 
the word 'remove' as the subject.
We will remove you from the mailing list.



gcc 4.1.1, template specialisation, -O3

2006-06-13 Thread Gavin Band
Hello,
I hope this is the right place for this sort of question, which concerns
the behaviour of gcc (versions 3.4.4 and 4.1.1) and template
specialisations.

I have some code split into three files header.hpp, specialisation.cpp,
and main.cpp, given below.  A class having a template member function
print() is defined in "header.hpp", and a specialisation of print() for
std::strings is defined in "specialisation.cpp".  In "main.cpp" print()
is used to print an integer and then a string.

Without any optimisation turned on (i.e. compiling with the command line

"g++ -o test test.cpp specialisation.cpp")

the program output is

$ ./main
The object of type T was: 256.
The string was: hello.

If I compile with -O3, however, I get

$ ./main
The object of type T was: 256.
The object of type T was: hello.

Let me call the former behaviour "good" and the latter "bad" - here are
the optimisation flags which cause "good" and "bad" behaviour on my
machine:

gcc 3.4.4:  good: -O0, -O1 bad: -O2 or greater.
gcc 4.1.1:  good: -O0 bad: -O1 or greater

But perhaps it is not gcc but rather my code that is at fault?  This is
on a Linux box.  The code is below.

Thanks for your help,
Gavin Band


- file header.hpp --

#ifndef HEADER
#define HEADER

#include 

struct A
{
  template
  void print(std::ostream& out, T const& t)
  {
 out << "The object of type T was: " << t << ".\n";
  }
};

#endif

-- file specialisation.cpp --

#include 
#include 
#include "header.hpp"

template<>
void A::print(std::ostream& out, std::string const& t)
{
  out << "The string was: " << t << ".\n";
}

-- file main.cpp --

#include 
#include 
#include "header.hpp"

int main(int argc, char** argv)
{
  std::string s("hello");
  int i(256);

  A a;
  a.print(std::cerr, i);
  a.print(std::cerr, s);

  return 0;
}

-- end of files --