473,396 Members | 1,864 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.

namespaces and forward declarations


Hi,

I have two libraries that used different namespaces, call them "fruit" and
"vegetable." In one of the class definitions of fruit, I have the following.

class corn; //This doesn't work.

namespace fruit
{
class Apple
{
Apple( const vegetable::corn& )
{}
};

}

How do I do a forward declaration for something in a namespace?

thanks,
matthew
Jul 19 '05 #1
1 1997

"matthew polder" <ma************@kodak.com> wrote in message
news:bf**********@news.kodak.com...

Hi,

I have two libraries that used different namespaces, call them "fruit" and
"vegetable." In one of the class definitions of fruit, I have the following.
class corn; //This doesn't work.

namespace fruit
{
class Apple
{
Apple( const vegetable::corn& )
{}
};

}

How do I do a forward declaration for something in a namespace?

thanks,
matthew


Have you tried?

namespace vegetable
{
class corn;
}

john
Jul 19 '05 #2

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

Similar topics

3
by: mjm | last post by:
Folks, Please help me with the following problems: ******************************************** 1. I have a class template template<class Base> class Matrix : public Base { /* .... */ }
4
by: whithers | last post by:
How do I do forward declarations when namespaces are involved? For example, given the following: -------------------------------------ClassA.h #ifndef CLASSA_H #define CLASSA_H namespace...
6
by: Steven T. Hatton | last post by:
Should I be able to forward declare something from a namespace different from the current one? For example the following code compiles: //testdriver.hpp #ifndef TESTDRIVER_HPP #define...
4
by: Michael | last post by:
OK, I've got a load of classes and functions that deal with Fonts so i want to wrap them up into a namespace 'FontLib' Now I have a resource manager that takes a pointer to a FontLibrary, Now I...
36
by: Wilfredo Sánchez Vega | last post by:
I'm having some issues around namespace handling with XML: >>> document = xml.dom.minidom.Document() >>> element = document.createElementNS("DAV:", "href") >>> document.appendChild(element)...
1
by: ctor | last post by:
Hi, I'm experimenting with using a lot of different namespaces in my current project to see if it helps me keep my code more organized. In some ways I'm finding that it causes more problems...
4
by: lionheart | last post by:
Hi, I am currently trying to group my classes using namespaces. But since these groups are not really independend I end up to have a lot of forward declarations. My first approache was to...
5
by: brekehan | last post by:
I am kind of unclear how to put my class in a namespace. Most of my books give plenty of info on using one, but not on making one. What needs to be nested between the brackets? namespace...
1
by: jake77.lucas | last post by:
I'm using 2005.Net C++ compiler. I have a base class in namespace A (call it Class1). I derive another class from it, (call it Class2) defined in namespace B. This derived class contains as a...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.