C++
Can dynami ...
Site Language: English
Українська
English
Русский
Programming Tests
Login
Sign Up
Programming Tests
Theory
Snippets
Papers
Landing
Android
Prices
FAQ
Cosmo Story
Terms and Conditions
Privacy Policy
Cookies Policy
Send Feedback
Can dynamic libraries export template functions and classes?
All template classes and functions are automatically exported.
Only specified template functions and classes can be exported.
Templates cannot be exported - their implementation must be completely located in the included files (* .h, * .hpp etc.)
Explanation
Get an explanation when it's available:
Subscribe
class
function template
template
Like
Login in
to like
Comment
Login in
to comment
Share
Tweet
Related Content
Что нужно вписать вместо точек, чтобы данный код скомпилировался: #include <iostream> using namespace std; template<...> // insert code here void OtherFunc() { T(); } void printIt() { cout << "Func"; } int main() { OtherFunc<printIt> (); return 0; }
При данном определении класса, какой вывод будет у этой программы? #include <iostream> class A {}; template<class T> class B { int i; public: int func(B<A>& c) { c.i = 3; return c.i; } }; int main() { B<int> a; B<A> b, c; std::cout<<a.func(c)<<b.func(c); }
Что произойдет после, если попытаться скомпилировать этот код? template<class T> class Object { public: Object(std::string& name, const T& value):nameVal(name), objectVal(value){}; ~Object(); private: std::string& nameVal; const T objectVal; }; std::string new("Good"); std::string old("Bad"); Object<int> p(new, 2); Object<int> s(old, 20); p = s;
Скомпилируется ли следующий код? template <class T> struct A { template <class K> A(K a) { } };
Какие фрагменты кода из перечисленных содержат ошибки:
C
++
Quiz
Login to learn C++
or
Read more about
C++ Quizzes
Follow CodeGalaxy
Mobile Beta
Send Feedback
Keep exploring
C++ quizzes
int main() { const int* i = int(); // 1 int const* j = int(); //2 int* const k = int(); //3 int* l(); //4 ++i; //5 ++j; //6 ++k; //7 ++*k; //8 ++l; //9 } Откомпилируется ли такой код? Если нет, то в каких строчках будут ошибки компиляции? После стандарта C++14.
Какой результат работы программы? #include <iostream> using namespace std; void f(double) { cout<<"f1"<<endl; } void f(const int ) { cout<<"f2"<<endl; } void f( int & ) { cout<<"f3"<<endl; } void main(void) { int n = 1; double b = 2; f(n); f(b); }
#include <iostream> using namespace std; int &test() { static int a = 3; return a; } int main() { ++++++test(); cout << test() << endl; return 0; } Что выведет cout?
При истинности какого из приведенных высказываний имеет смысл вычитание указателей?
Какое ключевое слово используется для описания пространства имен?
В чем разница между X x; и X x(); ?
Sign Up Now
or
Subscribe for future quizzes
Login in to like
Login in to comment