Hi. I have two functions: U do_something(T a, T b) { return U(something); } template<typename First, typename ... Rest> U do_something(First first, Rest ... rest) { ret...
Hey, could someone help me understand how I can link a third party library using cmake? In my case I'm trying to link asio with my project. I found some solutions online. One ...
Hi. I've got this: lib.h namespace lib { T func(U arg); } lib.cpp #include "lib.h" T lib::func(U arg) { // implementation } And I have a test.cpp where I call t...
This discussion made me wonder what would happen if I allocated something in an infinite loop. Would it eat all the ram it can eat or are there any limits to prevent this?
uint64_t combine_squares(Square square = 0) { return square; } template<typename First, typename ... Squares> uint64_t combine_squares(First first, Squares ... rest) { ...
could anyone explain why this is so?
hi, I'm creating a c++ shared library (cmake). in the implementation file I've got several static helper functions. to keep it clean I've thought I could create a private head...
Мне кажется я очень плохо высказал мои мысли(простите). Я не должен был изменить текст ячеек а просто добавить новые row с текстом в каждом ячейке. Поэтому я продолжил испол...
Hi guys. void reverse(string str) { string tmp; unsigned int l = str.length(); tmp.reserve(l); for(auto *end = &str[l-1]; *end >= str[0]; --*end) { tm...
Hi. Just to clarify. I'm using c sockets on linux. so, on server side to handle all those sockets we can use polling or select() or something else. Now, on client side, to kee...
So is it a very bad course? Object-Orient Programming,Member functions, Constructors, Access control,Static members and member functions,Operator overloading, Inheritance, Vir...
void Notify::mousePressEvent(QMouseEvent *e) { if ( e->buttons() == Qt::LeftButton && tbar->rect().contains(e->pos()) ) click_pos = e->pos(); } void Notify::mouseMoveEv...
Guys is it possible to combine C/C++ with python in a good/cool project? I mean if so, are there any ideas of such projects? I will need to use rpi too, not neccessarily for e...
Привет, нужен ваш совет. Я там делаю мой консоль без системных команд. Хочу делать диалоги между консоли и юзера. А для этого нужен инпут. Могу делать с море иф-ами но это во...
Можете мне объяснить лучший способ чтобы делать такое? mainwindow.h Class MainWindow : QMainWindow { public: MainWindow(...); private: QWidget * widget; }...
Guys I am coming from c++ I've never tried to learn C itself. Tho I'm familiar with its basics, I haven't used pointers very much. What would you suggest to me? Pick up a proj...
#include <iostream> class Singleton { private: /* Here will be the instance stored. */ static Singleton* instance; /* Private constructor to p...
Lol. Guys,the last time I had touched c++ was this summer, just one week. I've had some friends who gave me some important advice. More than a half year has passed since then,...
QRect screen = QApplication::desktop()->geometry(); window.move( screen.right() - 600, screen.top() ); screen.~QRect(); window.show(); Пока программа не законч...
Guys there is the Qt namespace in Qt. By using that I can access all the enumerators of all enums, like Qt::AlignLeft, here AlignLeft is an enumerator of the enum AlignmentFl...