Page 1 of 1
C++ questions!!!!
Posted: Sat Feb 22, 2003 1:16 am
by punknad
Hi!
I want to know whether you use restriction in your c++ way of coding?
For portability on "computer" like zaurus, pocket pc, aso... I mean!
do you use:
-template
-reference "&"
-const
-new/malloc
-stl
-namespace
-multiple inheritance
-exception
?
and why?
U7/Exult rules!!!
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 2:29 am
by Darke
AFAIK, there's no restrictions needed for the Zaurus. IIRC, though there's quite a few restrictions needed for the pocket PC, Colourless knows about them.
Usually if you just write simple, standards compliant C++, it'll compile anywhere with minimal fuss. If it doesn't, you're using MSVisual C++. *grin* *duck!*
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 2:58 am
by punknad
Colourless can you tell me about pocket Pc C++ restrictions?
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 4:02 am
by wjp
IIRC, it has trouble with exceptions and dynamic_casts
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 4:05 am
by Colourless
PocketPC restrictions are:
1) Execptions not supported
2) Doesn't come with any STL support. Can be sort of added in from 3rd party source though
3) C Standard Library is not complete. It's missing a number of functions.
Plus any other issues that come with using MSVC.
As with MSVC, namespaces are strictly enforced, however, as also with MSVC, the C Standard Library is not placed in the std namespace. This obviously will cause annoying problems.
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 4:50 am
by punknad
thank you for your advices...
Does anyone abour website talking about problem of portability with C++
on small platform with poor C++ compiler?
sum up about what colorless dragon and wjp told me:
-template ??
-reference "&" ??
-const ??
-stl -> no available on pocket pc
-namespace -> I haven't understood(because of my non-fluent english!): Should I use it or not?
-multiple inheritance -> avoid troubles
-exception -> no
-beware of C standard library, not every fn are supported
-dynamic cast -> avoid
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 6:12 am
by Colourless
Only really sucky platforms will not support templates and references. Every platform should support const.
namespace use can be unavoidable with things like the standard library. However, generally you should attempt to avoid using them in your code. There may be cases though where no matter what you do, you will need to have #ifdef code for specfic compilers.
Of, yeah, dynamic_cast is also not supported on Pocket PC. However you can always use virtual functions to do the same things as dynamic cast when required.
If you really wanted to, you could also attempt to design a RTTI system yourself and attach it to each class and then have a fully functional dynamic cast system. Probably not required, but you could do it if you really had to.
Re: C++ questions!!!!
Posted: Sat Feb 22, 2003 6:34 am
by punknad
thank you multi-color-dragon!
sum up about what **colorless** dragon and wjp told me:
-template -> ok
-reference "&" -> ok
-const -> ok
-stl -> no available on pocket pc
-namespace -> avoid
-multiple inheritance -> avoid troubles
-exception -> no
-beware of C standard library, not every fn are supported
-dynamic cast -> no
thank you very much!!