From owner-freebsd-current@FreeBSD.ORG Wed Nov 13 15:18:10 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3290B96F; Wed, 13 Nov 2013 15:18:10 +0000 (UTC) Received: from mail-ve0-x230.google.com (mail-ve0-x230.google.com [IPv6:2607:f8b0:400c:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C131E28EA; Wed, 13 Nov 2013 15:18:09 +0000 (UTC) Received: by mail-ve0-f176.google.com with SMTP id c14so409438vea.35 for ; Wed, 13 Nov 2013 07:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZLqGGbuQN6bWiT6lHcBWyyqncfZh5PBKh7DNfRp3wj0=; b=z+P96aW/82lO2D7j8FbWewp5cUofkgslJFB7XqtJDGWXVbMtx1mmfwHSMGCGB3Jjdy tBvpBkRBH0+2tZMFoBXAVXy8wefCZ6C2ALJwDImNRj/2g6DkmwzFe/djcedAlWkARyW6 VUyoFb8Nzhyr9ntdrjKmDQv9kQ+W29QVuh5e5qxbpjXOzWNbe5dDt2ph9yqjpfjMsuZy GDi6XsnQe5oD0NLae8QvcpOZbtISBWdGJ/M/4pC9NEZNhfmYf8IN8vMB0Ri8IkQImyr8 bEb5R6/JgV1zYi/sVFPp4sOoHErRWQD8hYyR+WoolOxBZD5DJjpARpQGug0Ab4H8AEkB EINA== MIME-Version: 1.0 X-Received: by 10.52.64.143 with SMTP id o15mr29863426vds.16.1384355888996; Wed, 13 Nov 2013 07:18:08 -0800 (PST) Received: by 10.221.0.145 with HTTP; Wed, 13 Nov 2013 07:18:08 -0800 (PST) In-Reply-To: References: <20131112163219.GA2834@troutmask.apl.washington.edu> <20131112165422.GA2939@troutmask.apl.washington.edu> <201311121321.07330.jhb@freebsd.org> <9071A5A2-9F8D-4F5A-9EAD-66A680246AFE@FreeBSD.org> Date: Wed, 13 Nov 2013 10:18:08 -0500 Message-ID: Subject: Re: Are clang++ and libc++ compatible? From: Zhihao Yuan To: David Chisnall Content-Type: text/plain; charset=UTF-8 Cc: Eitan Adler , FreeBSD current , Steve Kargl X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Nov 2013 15:18:10 -0000 On Wed, Nov 13, 2013 at 9:51 AM, Zhihao Yuan wrote: >> An implementation of the vector class might allocate all of the elements on the heap lazily, but it's not required to and could equally have space for a small number inside the object, expanding to something like this: >> >> struct Entry { >> struct MangledNameOfVectorOfEntry { >> size_t size; >> Entry small[4]; >> Entry *ptr; >> }; >> }; > > If you don't learn C++, then just don't make claims like these. If I can > not recursively declare std::array, which is totally allocated on > stack with layout exactly same as T[N], I would say this implementation > is mad. Sorry, this part is wrong. Stack allocation does require complete type. > A deque is more akin to an array, so in C it would be something like: > [...] > This is clearly nonsense - you can't have a structure that contains itself. > [...] These part has nothing to do with C++. -- Zhihao Yuan, ID lichray The best way to predict the future is to invent it. ___________________________________________________ 4BSD -- http://4bsd.biz/