This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Idea for export Implemnation
Jason Merrill wrote:
>
> >>>>> Kevin Atkinson <kevinatk@home.com> writes:
>
> > I am glade someone has actually thought about how to implement the
> > export keyword. Do you think you will have something ready by egcs 1.2?
>
> No.
Ok do you have any idea when?
>
> >> And then there's the question of how to handle inlines; the initial
> >> implementation probably won't inline anything in an exported template.
>
> > I always thought that inlines should ALWAYS go in the header files. I
> > thought the export keyword was only for non-inline templates. Am i
> > missing something here?
>
> I mean, expanding arbitrary inline functions within instantiations of
> exported templates, not inline exported templates.
I am a little confused here. If we have:
// templ.hh
template <class T>
class foo {
T value;
public:
T inline_func() {return 2*T}
T normal_func();
};
// templ.cc
export template<class T>
T foo<T>::normal_func() {
// ...
}
Will inline_func not get inlined becuase foo hase exported member
functions?
> > Ok but what about libraries? Will there be no shared template
> > instations for libraries?
>
> Libraries will be handled exactly the same way. I'm not sure what you're
> asking.
What I mean is if two different applications use a vector<int> will this
code be shared are will they each have there own copy.
--
Kevin Atkinson
kevinatk@home.com
http://metalab.unc.edu/kevina/