2011/1/24 Vivek <vivek@xmain.com>
That's perfect. I didn't make the connection that a function invocation only requires types that are *convertible* to the argument types, not necessarily exactly the argument types. And the conversion operator can handle fetching the data. And yes, the data source is a singleton.

Still one thing to note:
IIRC, the order of evaluations of args involved in a function call is not guaranteed, so I hope the order of  "data_source<T>().pop()" called does not matter in your case, if it does matter, I'm not sure whether you'll get the right result...