220 21318 <1894409.GHBCqMxsGN@tjmaciei-mobl4> article
Path: news.gmane.org!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: missing hash_code result in P0029
Date: Mon, 05 Oct 2015 21:58:06 +0100
Lines: 41
Approved: news@gmane.org
Message-ID: <1894409.GHBCqMxsGN@tjmaciei-mobl4>
References: <d714437b-638b-4a72-9e0a-35c4f6e9e484@isocpp.org> <1572715.jJmjmrJA0J@tjmaciei-mobl4> <CAFmGaCoRKXE9pVUpW=qD8or8Z-pXa3Ve8DMUjDJg-=+w66awsA@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Trace: ger.gmane.org 1444078704 1182 80.91.229.3 (5 Oct 2015 20:58:24 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Mon, 5 Oct 2015 20:58:24 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBY6IZOYAKGQEUWBOYEQ@isocpp.org Mon Oct 05 22:58:13 2015
Return-path: <std-proposals+bncBCB4TK757YBRBY6IZOYAKGQEUWBOYEQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wi0-f198.google.com ([209.85.212.198])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCB4TK757YBRBY6IZOYAKGQEUWBOYEQ@isocpp.org>)
	id 1ZjCpo-0006IZ-HL
	for gclcip-std-proposals@m.gmane.org; Mon, 05 Oct 2015 22:58:12 +0200
Original-Received: by wisv5 with SMTP id v5sf33932938wis.0
        for <gclcip-std-proposals@m.gmane.org>; Mon, 05 Oct 2015 13:58:12 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:from:to:subject:date:message-id:user-agent
         :in-reply-to:references:mime-version:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=8NXWE0ZblOXOvH1WBrYsF9haU36/5IXmUGkdwuwrmhc=;
        b=Tw87yG/1+fH69gGAK4ZObcUvDu23vQz8y9pVJjH+pi3YRATpiK/C32B6WhIMq54qr1
         fCrhtjMb3o3cQC5822uirk0NdL0GtZduZZScR2XvV5qmWol9vUGiVZZZUXSBTuLBQdNR
         3wOhikesfqfqhliQM+MOsKe84kq+Mq+s1/BWh3u+iB+hPwzLAsn9PjAAyqy+IlmrXEQB
         SEHrWX1ieiAtibE3USLBYA03yllNCwYjq2PioIonmKv0WCyMLWtxH1gHe9CaJQnSz1TJ
         AeXfr9ly+juanyk1cnOSV3oOWMnHYvwgkVNTTvPmDG1mfvNduZ9X5M45O5klsExS3iqW
         3nAw= 
X-Gm-Message-State: ALoCoQmACm2JbSIHphk3ZYer8IngeqfS2vf/Ag4vbR2DOuM/koDkyh2/+F78JHqTxQFMq0VT15D1
X-Received: by 10.112.136.99 with SMTP id pz3mr4103886lbb.11.1444078692102;
        Mon, 05 Oct 2015 13:58:12 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.180.35.225 with SMTP id l1ls943211wij.2.gmail; Mon, 05 Oct
 2015 13:58:11 -0700 (PDT)
X-Received: by 10.194.5.35 with SMTP id p3mr39015794wjp.132.1444078691068;
        Mon, 05 Oct 2015 13:58:11 -0700 (PDT)
Original-Received: from gondolin.macieira.info (gondolin.macieira.info. [78.47.120.188])
        by mx.google.com with ESMTP id cv8si18911060wib.45.2015.10.05.13.58.10
        for <std-proposals@isocpp.org>;
        Mon, 05 Oct 2015 13:58:10 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) client-ip=78.47.120.188;
Original-Received: from tjmaciei-mobl4.localnet (unknown [79.140.208.123])
	by gondolin.macieira.info (Postfix) with ESMTPSA id A0C3111B5AC
	for <std-proposals@isocpp.org>; Mon,  5 Oct 2015 13:58:10 -0700 (PDT)
User-Agent: KMail/4.14.9 (Linux/4.1.6-1-desktop; KDE/4.14.9; x86_64; ; )
In-Reply-To: <CAFmGaCoRKXE9pVUpW=qD8or8Z-pXa3Ve8DMUjDJg-=+w66awsA@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 78.47.120.188 as permitted sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:21318
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/21318>

On Monday 05 October 2015 17:34:04 Shahms King wrote:
> You can trivially use them in your own hashing container, as you would
> now.  The primary thing that is being changed is the mechanism by which
> user-defined types can supply their data to the hash function, not the
> interface for retrieving final values from that hash function.  The
> high-level API for retrieving a hash value from an object is unchanged, e.g.
> 
> template <typename T>
> struct hash {
>   size_t operator() (const T& value) const {
>     std::hash_code state = __implementation_defined_init();
>     state = hash_value(state, value);
>     return __implementation_defined_extract_value(state);
>   }
> };

If by __implementation_defined_init(), you mean the way I will initialise the 
hash from my hash seed, I understand. But what constructors and assignment 
operators will std::hash_code have so I can create it from my hash seed?

As for the extract value, I don't get it.

Can you give as example the two most trivial implementations? That is, the one 
where there's no extra state before or after the hashing of the value type (no 
seed) and the one where the seed is just a global integer value initialised 
from a random source.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.
