Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 59914 invoked from network); 24 Nov 2007 01:13:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Nov 2007 01:13:17 -0000 Received: (qmail 52916 invoked by uid 500); 24 Nov 2007 01:13:04 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 52904 invoked by uid 500); 24 Nov 2007 01:13:04 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 52893 invoked by uid 99); 24 Nov 2007 01:13:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Nov 2007 17:13:04 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of msebor@gmail.com designates 209.85.146.180 as permitted sender) Received: from [209.85.146.180] (HELO wa-out-1112.google.com) (209.85.146.180) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Nov 2007 01:12:44 +0000 Received: by wa-out-1112.google.com with SMTP id n4so10345929wag for ; Fri, 23 Nov 2007 17:12:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; bh=PNajOa7mlnqWCR3atL/kh7qUktlxHEnccbzRSFNNujo=; b=b10TDxYk41KD5EGuQnIRuPKym670EMjiB3n/lHqbCO4AIjf0tuTiY0eYpWUuPt8kgoRdk5YZAZazzHq86OjSxBJsc0t1uybSWeidfLTc3rKj+ShQCR3dt2FR7ZXHmMp+mk34ljz0PFXo1uK2xDPn/MOxeckfio4Plb0nwdH1AWA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:organization:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=VzZVB+dI7/5DN0okTZJC43zWJv5tZvpsojn/kJXFn51jYKMIugrIcLvhHTMC+JEEkxeJsgrQciSair/F5GTYQRy3QNVT+EfgscnVgpFOPMH761vMcS5ME4Q0iBozw9f6ey/l2O0w5kj5gqcMeW3RStSD83MUpkZIWUYBMy7kW38= Received: by 10.114.130.1 with SMTP id c1mr496134wad.1195866764054; Fri, 23 Nov 2007 17:12:44 -0800 (PST) Received: from bugsy.sebor.net ( [71.229.200.170]) by mx.google.com with ESMTPS id v38sm4953279wah.2007.11.23.17.12.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 23 Nov 2007 17:12:42 -0800 (PST) Message-ID: <47477A82.5090105@roguewave.com> Date: Fri, 23 Nov 2007 18:12:34 -0700 From: Martin Sebor Organization: Rogue Wave Software, Inc. User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: stdcxx-dev@incubator.apache.org Subject: Re: question on the examples for the source/forward/backward incompatible changes References: <7BDB2168BEAEF14C98F1901FD2DE643801482A48@epmsa009.minsk.epam.com> In-Reply-To: <7BDB2168BEAEF14C98F1901FD2DE643801482A48@epmsa009.minsk.epam.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Martin Sebor X-Virus-Checked: Checked by ClamAV on apache.org Farid Zaripov wrote: > Whether these examples should be abstract, or based on C++ Standard > Library > declarations/definitions? Examples using the C++ standard library classes or functions would be great, but any other sort will, in my opinion, work just as well. The point is to highlight the general kind of changes people might easily think are compatible when in reality they're not. > > Since the source incompatible changes involves changes in > function/class mebmers > prototype, or changes in global data/class data members declaration, or > changing the > place of the some declaration (i.e. moving the declaration from one > header file to the another), > but requirements of the all of this are stated in C++ Standard and, > accordingly, any of these > changes are impossible. Let me give one example where this isn't true. The standard leaves it up to each implementation to decide whether to define overloads of certain functions or whether to make use of default function arguments. For instance, vector::resize() can be declared in one of two ways: resize(size_type, value_type = value_type()); or resize(size_type); resize(size_type, value_type); Changing from one form to the other is detectable and might qualify as a breaking change. First, programs that explicitly instantiate vector on a user-defined type that's not default constructible will compile with the first declaration but not with the second (because the definition of the first overload must default-construct the element). Second, programs that take the address of such functions will not compile. The standard leaves the exact type of library member functions unspecified so it's up to us whether we want to go a step beyond and provide a stronger guarantee or not. Martin