Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

_declspec(noinline) issue

3 views
Skip to first unread message

ZhangFan

unread,
Oct 13, 2008, 3:45:00 AM10/13/08
to
Hi,
I use the "_declspec(noinline)" to tell the compiler not to expand the
function for
the delay load purpose. Here's the code in the header file:

class My_EXPORT A
{
_declspec(noinline) A();
}
inline A::A()
{...}

I use the _declspec(noinline) in the function declaration while use
"inline" in the definition.
compiles It but it looks a little confusing. Is there a conflicts or any
risk here?
Thanks.

Igor Tandetnik

unread,
Oct 13, 2008, 4:28:27 PM10/13/08
to
"ZhangFan" <zf_840201(remove)@hotmail.com> wrote in message
news:6340DBFF-3259-4321...@microsoft.com

What's the point of the exercise? Why not just move A::A implementation
to a separate .cpp file?
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


ZhangFan

unread,
Oct 13, 2008, 9:32:01 PM10/13/08
to
Moving to cpp would work, but needs more modification. And some classes of my
project do not have cpp file. So I choose to use the above solution. But I'm
not quite sure whether my solution would bring any problem.
0 new messages