Created on 2009-03-03.00:00:00 last changed 187 months ago
Additional note, June, 2009:
Here is an example illustrating the question:
auto concept Fooable<T> { void foo(T); } struct test_type { void foo() { cout << "foo test_type\n"; } }; concept_map Fooable<test_type> { void foo(test_type& t) { t.foo(); } } void foo(int x) { cout "foo int\n"; } template<typename T> requires Fooable<T> function<void(T)> callback(T t) { void(*fn)(T) = foo; return fn; } int main() { auto fn1 = factory(test_type{}); auto fn2 = factory(0); fn1(test_type{}); fn2(0); return 0; }
If we cannot bind references/take address of functions in concept_maps, does that mean we cannot use generic bind in constrained templates? Launch threads with expressions found via concept map lookup? Hit problems creating std::function objects? Does the problem only occur if we use qualified lookup to explicitly name a concept map? Does it only kick in if we rely on the implicit function implementation provided by a concept_map, so some types will work and others won't for the same algorithm?!
History | |||
---|---|---|---|
Date | User | Action | Args |
2009-08-03 00:00:00 | admin | set | status: open -> concepts |
2009-06-19 00:00:00 | admin | set | messages: + msg2064 |
2009-03-03 00:00:00 | admin | create |