Problems using omanip

D

David Williams

Hi,

I am having some difficulties compiling a library written by someone else,
and was hoping someone could indicate what's wrong! I have cut the code
down to what I believe to be the relevant part. If anyone can suggest how
to make the following code compile it would be greatly appriciated.

#include <iostream>
#include <iomanip>

std::eek:stream& ket(std::eek:stream& os, char* ket_val)
{
return os << " |" << ket_val << '>';
}

std::eek:manip<char*> ket(char* ket_val) //Error occurs here
{
return std::eek:manip<char*> (ket, ket_val);
}

From the compiler (g++ 3.3.1) I get:

test.cc:9: error: syntax error before `(' token

I believe the code was supposed to compile on earlier versions of the
compiler. I have made small changes such as removing '.h' from the headers
and putting 'std::' before some classes.

Thanks in advance for any help you can give,

David
 
V

Victor Bazarov

David Williams said:
I am having some difficulties compiling a library written by someone else,
and was hoping someone could indicate what's wrong! I have cut the code
down to what I believe to be the relevant part. If anyone can suggest how
to make the following code compile it would be greatly appriciated.

#include <iostream>
#include <iomanip>

std::eek:stream& ket(std::eek:stream& os, char* ket_val)
{
return os << " |" << ket_val << '>';
}

std::eek:manip<char*> ket(char* ket_val) //Error occurs here

There is no template "omanip" in C++ standard library.
{
return std::eek:manip<char*> (ket, ket_val);
}

From the compiler (g++ 3.3.1) I get:

test.cc:9: error: syntax error before `(' token

I believe the code was supposed to compile on earlier versions of the
compiler. I have made small changes such as removing '.h' from the headers
and putting 'std::' before some classes.

It doesn't make a class standard if you simply put 'std::' before it.

If you've been using some kind of library extension and want to keep
using it, please talk to GCC people. In the Standard C++ there is no
'omanip'.

Victor
 
D

David Williams

Ok, if it's not standard C++ I'd probably rather not be using it anyway.
I'll probably try to replace it with my own code to do something similar.
Thanks for your help.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,414
Latest member
GayleWedel

Latest Threads

Top