python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
What is wrong with this code? The answer should be 24 for this question right?
What is wrong with this code? The answer should be 24 for this question right?
int t;
vector<int>arr={24,434};
for(int i=arr.size()-1;i>=(arr.size()-2);i--)
{
t=i;
}
cout<<a...
Himanshu Chand
Votes: 0
Answers: 2
How to use bool member function in is_integral_v?
From this cppreference link, is_integral has bool as a member function. How to use it? I could understand other members, and am able to code a simple example as follows. But how to use the bool member...
balu
Votes: 0
Answers: 1
how to prevent priority queue from having duplicate values at c++
now I'm trying to use priority queue in c++ like this
struct compare
{
bool operator()(const int &a, const int &b)
{
return weight[a] < weight[b];
}
};
priority_queue<...

Omar Fareed
Votes: 0
Answers: 1
Is there any safe way to derive the offset of a T inside a std::optional<T>?
Given a std::optional<T> is it possible to derive the address of the std::optional<T> from the address of the T?
possible implementation:
template<typename T>
struct myoptional
{ ...
Frank Puck
Votes: 0
Answers: 1