EN VI
Posts (0)
Questions (49)
2024-03-14 01:00:08
This code snippet Foo x; Foo other; if constexpr (std::is_copy_assignable_v) { other = x; } is pesent in a non-template function. So the compiler checks the validaty of the code. On the other han...
Tags: c++ c++17 type-traits
2024-03-14 07:30:05
first of all, I have done this exact thing before, and I would recommend using a class over a struct, either way, if you want the operator - to work on MyVector.end() - MyVector.begin() it has to go i...
Tags: c++ c++14
2024-03-14 18:30:04
This is undefined behavior. I am not 100% certain that means the thread begins execution as soon as the jthread base object is constructed No, that means that the new thread begins executing at some...
2024-03-14 22:30:06
It depends on the struct definition and types (it must describable by a type library), but yes, you can create a struct like this in C# [ComVisible(true)] [StructLayout(LayoutKind.Sequential)] public...
Tags: c# c++ com
2024-03-15 01:00:06
Your compiler should warn you about this; if it does not, turn up your warnings! Vector() : _size(0), _capacity(8), _array(new T[_capacity]) You are trying to initialize your _array last, however, s...
Tags: c++ vector initialization
2024-03-15 04:00:13
You were on the right track using the remainder operator % (modulo), however you used the wrong divisor. A divisor of 10 will repeat a sequence of 10 numbers, whereas what you need is 4 numbers. So th...
Tags: c++ sequence
2024-03-15 04:30:04
template< class IntType = int > class uniform_int_distribution; The class only has one template parameter and it is int by default. In std::uniform_int_distribution dis(0, array.size() - 1); you are...
2024-03-15 07:00:07
I feel generous: #include #include using std::vector; using std::cout; using std::cin; int main() { int number; vector database; cout > number) { if (number == 0) break;...
Tags: c++
2024-03-15 18:00:09
You are right, 2 is larger than 1. However we still have other equal numbers which the difference of their abs value is
Tags: python c++
2024-03-15 19:30:05
I want to know why is the == version not compile but the || version does? Because the standard grammar explicitly allows || in a require-clause without parentheses but not == as explained below.. Fr...
Tags: c++ language-lawyer

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login