https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93904
Bug ID: 93904
Summary: LWG 561 not implemented: std::inserter overly generic
Product: gcc
Version: 9.2.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Target Milestone: ---
https://wg21.link/lwg561 was a change in C++11 but we don't implement it. That
means the following fails to compile:
#include <iterator>
#include <string>
namespace my
{
template <class String>
struct my_type {};
struct my_container
{
template <class String>
void push_back(const my_type<String>&);
};
template <class String>
void inserter(const my_type<String>& m, my_container& c) {c.push_back(m);}
} // my
int main()
{
my::my_container c;
my::my_type<std::string> m;
inserter(m, c);
}
The fix is simple, but should wait for stage1.