<pre> //====================== start of sample.cpp ========================== bind2nd(greater<int>(), 100); //====================== end of sample.cpp ========================== </pre> Какие утверждения про приведённый выше адаптер верны?
<pre> //====================== start of sample.h ========================== struct S_EMPTY {}; struct A { int i; double g; }; class B { long jj; public: char _str[6]; private: static char str_4_all[9]; }; union mytypes_t { int i; float f; } My; //====================== end of sample.h ========================== </pre> Доступ к каким из членов класса, описанных в файле sample.h (выше), является закрытым?
<pre> //====================== start of sample.h ========================== struct S_EMPTY {}; struct A { int i; double g; }; class B { long jj; public: char _str[6]; private: static char str_4_all[9]; }; union mytypes_t { int i; float f; } My; //====================== end of sample.h ========================== </pre> Доступ к каким из членов класса, описанных в файле sample.h (выше), является открытым?
<pre> //====================== start of sample.cpp ========================== Декоратор Компоновщик Мост Фасад //====================== end of sample.cpp ========================== </pre> К какой группе шаблонов относятся приведённые выше шаблоны объектно-ориентированного проектирования?
<pre> //====================== start of sample.cpp ========================== template <typename T> class multiplies: public binary_function<T,T,T> { public: T operator() (const T& x, const T& y) const { return x * y; } }; //====================== end of sample.cpp ========================== </pre> Какие утверждения про приведённый выше код функтора multiplies верны?
<pre> //====================== start of sample.cpp ========================== #include <climits> #include <limits> #include <boost/static_assert.hpp> namespace name { BOOST_STATIC_ASSERT(std::numeric_limits<int>::digits == 32); } int main(int argc, char* argv[]) { return 0; } //====================== end of sample.cpp ========================== </pre> Что случится c программой из файла sample.cpp если в системе размер int больше 32 разрядов?
<pre> //====================== start of sample.h ========================== struct A {}; struct B; struct B *pb = 0; struct A *pa = 0; struct B b; struct A a; void foo(const struct B& in_b); //====================== end of sample.h ========================== </pre> Какие присвоения и объявления в файле sample.h валидны?
<pre> //====================== start of sample.cpp ========================== template <typename ForwardIterator, typename T> void replace ( ForwardIterator first, ForwardIterator last, const T& x, const T& y) { while(first != last) { if (*first == x) *first = y; ++first; } return first; } //====================== end of sample.cpp ========================== </pre> Каковы требования к итераторам, участвующим в алгоритме replace(), имплементация которого приведена выше, корректны?
<pre> //====================== start of sample.cpp ========================== int main(int argc, char* argv[]) { int a = 0; int b = 0; int X = 0; auto lf1 = [a,b,X] (int x) {return x > 0;}; auto lf2 = [a,b] (int x) { x++; return x;}; auto lf3 = [=] (int x) { x++; return x;}; auto lf4 = [&] (int x) { x++; return x;}; auto lf5 = [] (bool& z) { z = !z; return;}; return 0; } //====================== end of sample.cpp ========================== </pre> Какие лямбда функции из примера выше имеют доступ к значению переменной X?
<pre> //====================== start of sample.cpp ========================== struct A { A(); virtual ~A(); private: A(A&a); A& operator=(const A& a); }; struct B: public A {}; struct C {}; struct D { D(); D& operator=(const D& d); }; //====================== end of sample.cpp ========================== </pre> Какие из типов из файла sample.cpp удовлетворяют требованию CopyConstructible?