Can string be an overloaded operator

S

Senthil

How can ``string'' and ``time_t'' be operator functions in the link
below? The two names are not keywords and not shown in the standard in
sec 13.5p1.

Thank you for your time.

<quote>http://www.tangentsoft.net/mysql++/doc/html/refman/datetime_8h-source...

00048 class MYSQLPP_EXPORT DateTime : public Comparable<DateTime>
00049 {

...

00165         operator std::string() const;
00166
00168         operator time_t() const;

...
</quote>

This is a typical example of a conversion operator..

A member function X::eek:perator T(), is a conversion operator where T is
any type name and X is the class name and it defines the conversion
from X to T.

Best Regards,
Senthil
 

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
474,170
Messages
2,570,925
Members
47,466
Latest member
DrusillaYa

Latest Threads

Top