473,396 Members | 1,608 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

problem with int_type....

My compiler seems unhappy with int_type

The method declaration is:

int_type dbgBuf::overflow(int_type ch)
{
#ifdef FF_DEBUG

if (traits_type::not_eof(ch))
{
if (at_start)
{
for (int i = 0; i < level; ++i)
{
if (log_on)
{
buffer->sputc(traits_type::to_char_type('\t'));
}
}
}

if (log_on)
buffer->sputc(traits_type::to_char_type(ch));

if (traits_type::eq_int_type(ch, traits_type::to_int_type('\n')))
{
at_start = true;
}
else
{
at_start = false;
}
}
#endif
return ch;
}
The error I'm getting is:

error: 'int_type' does not name a type.

So I tried:
traits_type::int_type dbgBuf::overflow(traits_type::int_type ch)

and I get:
error 'traits_type' has not been declared
error: 'int_type' has does not name a type

NOTE:
None of the other 'traits_type' like to_char_type or to_int_type seem
to be affected...
or maybe they just haven't been complied yet....
Is there perhaps a header file I'm forgetting to include?
MAC OS X. 10.4
XCode

Mar 29 '07 #1
4 3840
SpreadTooThin wrote:
My compiler seems unhappy with int_type
There is no "int_type" (by itself) in the C++ language.
>
The method declaration is:

int_type dbgBuf::overflow(int_type ch)
{
#ifdef FF_DEBUG

if (traits_type::not_eof(ch))
What's "traits_type"?
{
if (at_start)
{
for (int i = 0; i < level; ++i)
{
if (log_on)
{
buffer->sputc(traits_type::to_char_type('\t'));
}
}
}

if (log_on)
buffer->sputc(traits_type::to_char_type(ch));

if (traits_type::eq_int_type(ch, traits_type::to_int_type('\n')))
{
at_start = true;
}
else
{
at_start = false;
}
}
#endif
return ch;
}
The error I'm getting is:

error: 'int_type' does not name a type.
It probably doesn't.
>
So I tried:
traits_type::int_type dbgBuf::overflow(traits_type::int_type ch)

and I get:
error 'traits_type' has not been declared
It probably wasn't.
error: 'int_type' has does not name a type

NOTE:
None of the other 'traits_type' like to_char_type or to_int_type seem
to be affected...
The compiler reported the very first occurrence of 'traits_type' as
unknown. Just for laughs, replace the return value type with 'bool'
and see if you get any further.
or maybe they just haven't been complied yet....
Quite possible.
Is there perhaps a header file I'm forgetting to include?
Perhaps. How the hell should we know. Read the FAQ 5.8.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 29 '07 #2
SpreadTooThin schrieb:
My compiler seems unhappy with int_type

The method declaration is:

int_type dbgBuf::overflow(int_type ch)
{
#ifdef FF_DEBUG

if (traits_type::not_eof(ch))
We need the class definitions of dbgBuf and traits_type etc. to be able to
help you.

But just a guess: Try replacing int_type in the first line by
dbgBuf::traits_type::int_type.

--
Thomas
http://www.netmeister.org/news/learn2quote.html
Mar 30 '07 #3
On Mar 29, 10:59 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
SpreadTooThin wrote:
My compiler seems unhappy with int_type
There is no "int_type" (by itself) in the C++ language.
Yes, but...
The method declaration is:
int_type dbgBuf::overflow(int_type ch)
This looks awfully like he's writing a streambuf. If so, dbgBuf
should inherit from std::streambuf, and there is a type int_type
declared in std::streambuf, which the compiler should find here.

There are, of course, any number of things which could be going
wrong. All of which precede the code he's posted, so we can
only guess. Two quick guesses, however: dbgBuf doesn't inherit
from std::streambuf (or std::basic_streambuf<char>), or he's
including an older version of iostreams (i.e. <iostream.h>,
rather than <iostream>). If dbgBuf does derive from
std::streambuf, he should verify that he is actually including
<streambuf>, and not <iostream.h(or <iostream>---some older
implementations stupidly allowed you to drop the .h, while still
giving you a classical iostream, rather than the standard one).

What I don't understand here, of course, is why he's confusing
the issue by using int_type to begin with. Unless dbgBuf is a
template, he knows the actual types, and it's just a lot clearer
to use them. (And I would avoid making dbgBuf a template unless
it were absolutely necessary.)

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 30 '07 #4
On Mar 29, 10:59 pm, "Victor Bazarov" <v.Abaza...@comAcast.netwrote:
SpreadTooThin wrote:
My compiler seems unhappy with int_type
[...]
The method declaration is:
int_type dbgBuf::overflow(int_type ch)
Just a correction to my previous posting: if dbgBuf derives from
std::streambuf, the compiler should find
std::streambuf::int_type in the parameter declaration. For the
return type, the compiler doesn't yet know that it is processing
a member function of a class derived from std::streambuf, and so
will not find it. A scope qualifier is necessary:

dbgBuf::int_type dbgBuf::overflow( int_type ch )

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 30 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
4
by: Matt Chaplain | last post by:
Hi there. I'm writing a program that uses the Telnet protocol over TCP/IP sockets. Of course, that has no bearing here, so I'll rephrase that in Standard C++ :) In essense, I'm trying to...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
1
by: cwhite | last post by:
Hi! I've included some of my classes in the union in my grammar file: %union { int int_type; char* string_type; PNode* pNode; } %type <int_type> programs %type <pNode> program
10
by: hsmit.home | last post by:
Hi everyone, I'm having some difficulty with the following piece of code. I have stripped it to it's bare minimum to demonstrate the problem at hand. Compiler: MS Visual C++ 2005 Express...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.