Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » namespace upp
namespace upp [message #1427] Fri, 03 March 2006 18:03 Go to next message
am_upp is currently offline  am_upp
Messages: 3
Registered: March 2006
Location: Germany
Junior Member
I'm planning to use U++ together with another class lib. But I fear that I will get name clashes because the other library also defines classes named String and Point etc.

Putting all U++ symbols into a namespace (e.g. "namespace upp {..}) would avoid this kind of problems.

Good idea?

Andreas

PS: I could also blame the authors of other class lib for not using namespace. But this lib has been designed before namespaces were introduced to C++ (it's very old) and the class lib is no longer supported.
Re: namespace upp [message #1428 is a reply to message #1427] Fri, 03 March 2006 18:18 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
am_upp wrote on Fri, 03 March 2006 12:03

I'm planning to use U++ together with another class lib. But I fear that I will get name clashes because the other library also defines classes named String and Point etc.

Putting all U++ symbols into a namespace (e.g. "namespace upp {..}) would avoid this kind of problems.

Good idea?

Andreas

PS: I could also blame the authors of other class lib for not using namespace. But this lib has been designed before namespaces were introduced to C++ (it's very old) and the class lib is no longer supported.


Well, I am glad somebody opens this topic.

To tell the truth, we were considering "upp" namaspecs many times over th years, but always came to conclusion that the only "benefit" it would have would be adding "using upp;" into all sources...

At the times of VC6.0 (which are now gone for good), there was also the problem that some of our template techniques make compiler even more confused.. (no koening lookup available).

Therefore we have deferred this until first problems appear Smile Which seems to be now....

Mirek
Re: namespace upp [message #1432 is a reply to message #1428] Fri, 03 March 2006 18:44 Go to previous messageGo to next message
am_upp is currently offline  am_upp
Messages: 3
Registered: March 2006
Location: Germany
Junior Member
luzr wrote on Fri, 03 March 2006 12:18


To tell the truth, we were considering "upp" namaspecs many times over th years, but always came to conclusion that the only "benefit" it would have would be adding "using upp;" into all sources...



It would be a minor change to source code but would solve a major problem (at least for those who have that problem).

For the time being do you know a workaround to avoid these name clashes? Should I try to put the U++ symbols into a namespace by myself?

Andreas
Re: namespace upp [message #1434 is a reply to message #1432] Fri, 03 March 2006 18:49 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
am_upp wrote on Fri, 03 March 2006 12:44

luzr wrote on Fri, 03 March 2006 12:18


To tell the truth, we were considering "upp" namaspecs many times over th years, but always came to conclusion that the only "benefit" it would have would be adding "using upp;" into all sources...



It would be a minor change to source code but would solve a major problem (at least for those who have that problem).

For the time being do you know a workaround to avoid these name clashes? Should I try to put the U++ symbols into a namespace by myself?

Andreas


Actually, that would be an interesting experiment and very useful experiment Wink (However, I am not sure whether the change will be as "minor" as you expect).

Tell us how it goes!

Mirek
Re: namespace upp [message #1435 is a reply to message #1434] Fri, 03 March 2006 19:08 Go to previous messageGo to next message
am_upp is currently offline  am_upp
Messages: 3
Registered: March 2006
Location: Germany
Junior Member
luzr wrote on Fri, 03 March 2006 12:49

Actually, that would be an interesting experiment and very useful experiment Wink (However, I am not sure whether the change will be as "minor" as you expect).



With "minor change" I refered to the changes that will be necessary in user code, not in U++ itself.

All I could do is putting "namespace upp { ... }" all around the U++ source code. But I fear that is not the complete solution.

Andreas
Re: namespace upp [message #2978 is a reply to message #1434] Tue, 02 May 2006 17:17 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
[quote]
luzr wrote on Fri, 03 March 2006 17:49
For the time being do you know a workaround to avoid these name clashes? Should I try to put the U++ symbols into a namespace by myself?

Andreas [/quote



Actually, that would be an interesting experiment and very useful experiment Wink (However, I am not sure whether the change will be as "minor" as you expect).

Tell us how it goes!

Mirek


I was forced to do that with one of my packages. It seems to work but only if I "harmonize" the order of #include's...
Re: namespace upp [message #2982 is a reply to message #2978] Tue, 02 May 2006 17:56 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
[quote title=fudadmin wrote on Tue, 02 May 2006 11:17]
Quote:


luzr wrote on Fri, 03 March 2006 17:49
For the time being do you know a workaround to avoid these name clashes? Should I try to put the U++ symbols into a namespace by myself?

Andreas [/quote



Actually, that would be an interesting experiment and very useful experiment Wink (However, I am not sure whether the change will be as "minor" as you expect).

Tell us how it goes!

Mirek


I was forced to do that with one of my packages. It seems to work but only if I "harmonize" the order of #include's...




I am afraid "one of packages" is not enough. Correct experiment should put everything needed for minimal GUI application into upp namespace...

Mirek
Re: namespace upp [message #2983 is a reply to message #2982] Tue, 02 May 2006 18:04 Go to previous message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
I didn't "insulate" upp with namespace upp. I just "adapted" one more "namespaced" library (maybe I'll post it later...) and have been trying various "connection" with upp variants...
Previous Topic: opengl & tekstures
Next Topic: Geom package
Goto Forum:
  


Current Time: Sun Apr 28 00:21:33 CEST 2024

Total time taken to generate the page: 0.03986 seconds