Re: return const and assert

From: Victor Bazarov (
Date: 02/20/04

Date: Fri, 20 Feb 2004 02:49:30 GMT

"alexhong2001" <> wrote...
> When to return a const, from either a member function of a class or
> non-member?

When returning by value, 'const' really isn't of any use. It's
basically like adding 'const' when passing by value: means almost

> Is assert() only executed in debug mode but skipped in release mode?

Using your terminology, yes.

> I
> don't see much usage of "assert()." Am I missing its importance?

Probably. 'assert' is a debugging tool for code where you don't
want to have a run-time check once you cleaned everything up.