July 15, 2011 linker error 42 when using member function pointers of template classes | ||||
|---|---|---|---|---|
| ||||
Attachments: | see attached file, a more detailed description is included in the comments. For short; the linker outputs error 42 (undefined symbol) when using member function pointers of template classes. Identical code works for non-templates. | |||
July 16, 2011 Re: linker error 42 when using member function pointers of template classes | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Shinomori | I have done some more experiments and it
looks like a problem with the instanciation
of the member functions in templates.
When using:
func_ptr_type ptr = &function_name;
everything is fine, but with
func_ptr_type ptr[] = { &function_name };
it is not; function_name does not get instanciated
if not used otherwise.
So it is propably a compiler problem which causes
template functions not beeing instanciated when
their pointers are used inside arrays/structs only.
The functions are included when directly accessed,
however, using their pointer in e.g. an array should
also count as access, so my vague guess is an error
in the compiler.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply