https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61362
Bug ID: 61362
Summary: g++ (Ubuntu 4.8.2-19ubuntu1) 4.8.2 does not compile
lambda with template
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dgront at chem dot uw.edu.pl
Minimal example of the problem:
#include <functional>
struct Node {
size_t length;
};
template<typename N>
class C {
public:
size_t longest = 0;
std::function<void(const N )> f = [this](N node) {
if(node->length > this->longest) this->longest = node->length;
};
};
int main() {
Node n;
n.length = 5;
C<Node*> c;
c.f(&n);
}