useless function

J

John Goche

Hello,

Consider the following function RTest::String:

-----------------------------------------

http://www.symbian.com/developer/te...-cpp/N101CA/RTestClass.html#::RTest::String()

static inline const TAny *String(TInt aSel, const TText8 *aBuf1, const
TText16 *aBuf2);

Description

Utility function that returns a pointer to the specified TText8*
argument or the TText16* argument depending on the value of the aSel
argument.

-----------------------------------------

Anyone see any use for such a function? I cannot imagine what it could
be used for.
Ideas concerning any useful use/application of this function
appreciated.

Thanks,

JG
 
M

mlimber

John said:
Consider the following function RTest::String:

-----------------------------------------

http://www.symbian.com/developer/te...-cpp/N101CA/RTestClass.html#::RTest::String()

static inline const TAny *String(TInt aSel, const TText8 *aBuf1, const
TText16 *aBuf2);

Description

Utility function that returns a pointer to the specified TText8*
argument or the TText16* argument depending on the value of the aSel
argument.

-----------------------------------------

Anyone see any use for such a function? I cannot imagine what it could
be used for.
Ideas concerning any useful use/application of this function
appreciated.

You should ask about Symbian functions on a forum that deals with them
directly. This group deals with the C++ *language*, not third-party
libraries (see
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9).

[OT]I'd guess it allows you to select between an 8-bit text buffer and
a 16-bit text buffer. One could do the same with the ternary operator:

const TAny* const text = ( aSel ? aBuf1 : aBuf2 );

I presume the intent is to supply a little implicit documentation on
the purpose of the code, though I don't see it as all that helpful.
TAny, BTW, is just void, and converting to a void pointer is generally
frowned upon in C++ since it is not type-safe.[/OT]

Cheers! --M
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top