Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Re:Variadic function can have type safety.

Thread Tools

Re:Variadic function can have type safety.

Heribert Weinrot
Posts: n/a
If you use proper C++ there are several ways of handing over a variable
list of arguments to an object/method. See this example:

Logger l;
l.print("The price of $ is $ at $").sa("wheat").sa(16.66).sa("Monday,
17th, August 2011");

The trick here is that print() and sa() return the Logger object, so that
you can have a nice syntax. I did this with great success.
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Variadic function can have type safety. Nephi Immortal C++ 0 12-20-2012 05:48 AM
Can 2 columns of a DataGrid have a single heading OR can I have two controls in 1 column? mark4asp ASP .Net 2 11-11-2006 02:13 AM
How can I have one function call another function dynamically? Randell D. Javascript 38 07-19-2005 09:10 AM
write a function such that when ever i call this function in some other function .it should give me tha data type and value of calling function parameter komal C++ 6 01-25-2005 11:13 AM