c++11 - C++ Remove element from std::vector containing closures with variadic templates -
I have a class based on the code shown here:
The difference is that I < Strong> variadic template .
It works well, but I can not remove a callback from the vector because I am not able to find it.
Either I'm getting the error or I'm getting some strange value which I can not compare to finding the element.
The code that will not work:
for (auto i = this -> handler.bizen); i! = This-> handler.and ( ); I ++) {if ((* i). Target & lt; void (Args ...) & gt; () == f.target & lt; Zero (RGS ...) & gt; ) {It-> Handler Arrays (i); break; }}
I did a lot but I was not able to do anything for this matter. For example std :: find does not work in my case.
Any help is appreciated.
SILBERLING
EDIT: As far as I know the main problem is that the std :: function does not support == and! = Is there any way to get rid of this for the reasons? Is there no way to identify Lamdas, so should I remove it again? I mean, at least there is a place in her memory. Target_type () is another approach that I am trying to find but it "some attempts to refer to a deleted function"
< Try it: if ((* i). Template target & lt; void (T1) & gt; () == f / div> See .template target & lt; void (T1) & gt; ())
(maybe among others)
It should be compiled and working - Removing type of functions, Lamdab Other codebles are very difficult, zero (T1)
will not work and will always return nullptr
on both sides of your comparison.
Zero (*) (T1)
will work, if you were bound with the operator + =
, then there was a free function, however this member would not work for functions or lambs, though.
Even if you find a way to identify callable (I do not know, some silly) A, then you must still stored somewhere to be able to call to remove it.
In the future, if you actually make your codes and errors available, then it will be helpful, ideally, for example.
Comments
Post a Comment