this.Text = string.Format("current thread #{0}",
Thread.CurrentThread.ManagedThreadId);
var text = string.Format("current thread #{0}", Thread.CurrentThread.ManagedThreadId);
this.Invoke(()=> Text = text);
#include <algorithm>
#include <iostream>
class one
{
public:
one(std::string a) : _a(a) { }
std::string a() { return _a; }
private:
std::string _a;
int b;
bool c;
};
int main() {
const std::vector<one> ones = {
one("Vasya"),
one("Meh"),
one("Foo"),
one("Vasya"),
one("Vasya"),
one("Bar")
};
std::cout << std::count_if(
ones.cbegin(), ones.cend(),
[](one o){ return o.a() == "Vasya"; }
);
return 0;
}
после выполнения какой либо функции программа возвращалась на начало.