Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List<T> Find method in C++/CLI

Why it doesn't work in C++/CLI ?

_list->Remove(_list->Find(x => x.Inode == 2));

I received an error error C2065: 'x' : undeclared identifier

like image 541
Artem Kyba Avatar asked Jan 26 '26 14:01

Artem Kyba


1 Answers

@Hans Passant's comment is the answer, so I'm just pasting it here:

C++/CLI doesn't support lambda expressions. The language was frozen in 2005, no new bells and whistles were added to it since then. You'll need to use a delegate explicitly. C++11 got lambdas but they are not compatible with C++/CLI. – Hans Passant

like image 160
Matt Smith Avatar answered Jan 28 '26 07:01

Matt Smith



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!