public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: sotrdg sotrdg <euloanty@live.com>
To: libstdc++ <libstdc++@gcc.gnu.org>
Subject: transparent proxy of string_view as key for associative containers.
Date: Mon, 16 Nov 2020 06:43:03 +0000	[thread overview]
Message-ID: <CH2PR02MB6522ACC88083B9E4DD88EDD3B2E30@CH2PR02MB6522.namprd02.prod.outlook.com> (raw)

The code fails to compile for both unordered_map and map. Is this a bug of libstdc++ or a defect of WG21?
#include<unordered_map>
#include<string>
#include<string_view>
#include<map>

int main()
{
                std::unordered_map<std::string,std::string> umap;
                std::string_view key{"a key"};
                auto p{umap.find(key)};
                std::map<std::string,std::string> map;
                auto p1{map.find(key)};
}
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10


             reply	other threads:[~2020-11-16  6:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-16  6:43 sotrdg sotrdg [this message]
2020-11-16  7:26 ` Daniel Krügler
2020-11-16  9:57   ` Jonathan Wakely
2020-11-28 11:02     ` François Dumont
2020-11-28 11:17       ` Ville Voutilainen
2020-11-28 13:30         ` François Dumont

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CH2PR02MB6522ACC88083B9E4DD88EDD3B2E30@CH2PR02MB6522.namprd02.prod.outlook.com \
    --to=euloanty@live.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).