int x[5]{0,1,2,3,4}; int* y = x; std::cout << *(y + 2) << std::endl; Can I do something like this in python and numpy ? arr = np.array([0,1,2,3,4,5]) arr.array_interface['d...
Concurrency and parallelism have largely overlapping meanings with respect to multithreaded code. Indeed, to many they mean the same thing. The difference is primarily a matte...
why are you arguing on banning so obvious bots ?
void add_to_vector(std::vector<std::string>& vec, std::string str) { vec.push_back(std::move(str)); } void add_to_vector_2(std::vector<std::string>& vec, const std::string&...
why would people love js ?
I don't need to return reference to inserted elemnet so I used push_back rather than emplace_back. btw would there be any performance difference if I used emplace_back ?
class A { B b; . . } class B { A a; . . } does c++ support sth like this ?
how to extract data from string ? std::string str = "id : A pos : (1,2) : B , "; after extraction I should have these values : std::pair<int,int> pos(1,2); std::string id = ...
if I use pointers and allocate memory , again compiler cannot determine the size since it has one of the classes definition , right ? class B; class A{ public: ...
#include <type_traits> template<typename T1 , typename T2 , typename RT = std::decay_t<decltype(true ? T1() : T2())>> RT max(T1 a, T2 b) { return b < a ? a : b; } what do...
How do you request a feature on github ?
Is accessing a member function through uninitialized pointer, UB ?
code : template<typename T> concept Addable = requires (T x) { x + x; }; // requires-expression errors : error: ‘Addable’ does not name a type; did you mean ‘double’? conce...
btw what is C++ Runtime Library ?
size_t copyUntil = m_length < newSize ? m_length : newSize; char *copy = new char[newSize]; for (size_t i = 0; i < copyUntil; ++i) copy[i...
what is llvm ? I googled it but didn't understand it
what about copy and move constructors and assignment operators ?
so if we get the expected answer with ubs it doesn't mean it is valid right ?
what is the name of implemeting constructor like this ? class A{ private: int x; public : A(int x) : x(x) {}; };
Can anybody tell me what is wrong with vs ? yesterday it was working now vs gives errors to the same code 😐😐