auto _fun = fun(); //_fun == "main.d"
auto _tfun = tfun(); //_tfun == "main.d"
auto _tclass = new tclass!(); //_tclass.from == "other.d" !!!
//this works but i do not want to provide __FILE__ explicitly:
auto _tclassx = new tclass!(__FILE__)(); //_tclass.from == "main.d"
//and why do i get 2 diff
On 07/14/2012 08:53 AM, captaindet wrote:
i need a discreet handle on the calling/instantiating source file
(module). using __FILE__, it is surprisingly easy for functions (via
argument) and templated functions (via template parameter) but i cannot
get it working for templated classes. how can i
On Saturday, July 14, 2012 13:30:03 captaindet wrote:
> IIRC, __FILE__ is a template itself
It's not. It's a special symbol recognized by the compiler, and ends up in
several places in the grammar.
- Jonathan M Davis
On 2012-07-14 02:12, Jonathan M Davis wrote:
[..]
I believe that __FILE__ and __LINE__ are treated specially with
functions in order for them to be filled in at the call site rather
than the declaration site. If it's not working with classes, then
that probably means that whatever special logic w
On Saturday, July 14, 2012 01:53:34 captaindet wrote:
> i need a discreet handle on the calling/instantiating source file (module).
> using __FILE__, it is surprisingly easy for functions (via argument) and
> templated functions (via template parameter) but i cannot get it working
> for templated c