POV-Ray : Newsgroups : povray.off-topic : Teach yourself C++ in 21 days : Re: Days 5- Server Time
26 Sep 2024 17:45:29 EDT (-0400)
  Re: Days 5-  
From: Darren New
Date: 20 Apr 2012 23:45:55
Message: <4f922d73$1@news.povray.org>
On 4/20/2012 5:11, Warp wrote:
> Darren New<dne### [at] sanrrcom>  wrote:
>>> The book claims that if you write a function body inside a class definition,
>>> that makes the method inline. Is this true? I thought there was no
>>> difference either way...
>
>> It *has* to be.
>
>    It doesn't *have* to be (any more than any other function defined in a
> header file, or anywhere else), but the standard says it is, and so it is.

I meant, it *has* to be or it will link but won't compile, because you wind 
up compiling a version of the header file in each .c file it's included in.

Sure, it doesn't *have* to be implicitly inline, but since every function in 
a header file is either inline, or shouldn't be in the header file in the 
first place, or fails to link, it made sense to make the default "yes, 
please work."

-- 
Darren New, San Diego CA, USA (PST)
   "Oh no! We're out of code juice!"
   "Don't panic. There's beans and filters
    in the cabinet."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.