public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* transparent proxy of string_view as key for associative containers.
@ 2020-11-16  6:43 sotrdg sotrdg
  2020-11-16  7:26 ` Daniel Krügler
  0 siblings, 1 reply; 6+ messages in thread
From: sotrdg sotrdg @ 2020-11-16  6:43 UTC (permalink / raw)
  To: libstdc++

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-11-28 13:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16  6:43 transparent proxy of string_view as key for associative containers sotrdg sotrdg
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

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).