<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 ========================== int main() { Reader readers1[] = {"", ""}; std::vector<Reader> readers2; Reader reaedr3 = {(22, "Vasily", "Ivanov", 123456), (45, "Alex", "V", 993421) }; return 0; }//====================== end of sample.cpp ========================== </pre> Какие конструкторы должны быть определены для типа Reader, что бы инициализации массивов объектов этого типа и объявления контейнеров, приведённые в файле sample.cpp были успешными?
<pre> //====================== start of sample.cpp ========================== std::merge( vector1.begin(), vector1.end(), std::istream_iterator(cin), std::istream_iterator(), std::back_inserter(list1) ); //====================== 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(), имплементация которого приведена выше, корректны?