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!!!
C++ questions!!!!
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Re: C++ questions!!!!
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!*
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!!!!
IIRC, it has trouble with exceptions and dynamic_casts
-
- Site Admin
- Posts: 731
- Joined: Thu May 14, 2020 1:34 pm
Re: C++ questions!!!!
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.
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!!!!
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
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
-
- Site Admin
- Posts: 731
- Joined: Thu May 14, 2020 1:34 pm
Re: C++ questions!!!!
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.
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!!!!
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!!
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!!