c++11 tag

31 questions


2 answers
101 views
0
How do I determine the native endian at compile time?

At runtime, you can determine if the native endian is a little endian, for example:#include<iostream>const int bomb = 1;bool is_little_endian(){ return*reinterpret_cast<const char*>(&b...

2 years ago

1 answers
83 views
0
C++ structure

structure Edge {int to, cost; Edge(){} Edge(int to, int cost):to(to), cost(cost){};What does this mean?Is Edge(){} a function?

2 years ago

1 answers
119 views
0
APPLICATION OF HOMOGRAPHY CONVERSION TO IMAGE IN OpenCV

I would like to apply the homography matrix to the input image by cv::warperspectiveTransform().A memory access violation occurs. I tried many things referring to OpenCV warpperspective, but it didn't...

2 years ago

2 answers
121 views
0
About operator ""_ に"

located on page 309 of N3797 (pdf)template<char...>double operator_\u03C0();I don't understand the meaning of this.If the argument is empty, will 2 of 2_ の be ignored?Or what is the difference b...

2 years ago

3 answers
87 views
0
Error when member has unique_ptr in c++ forward declaration (error: invalid application of 'sizeof' to an incomplete type 'B')

There is a compilation error in unique_ptr, and I don't know even if I look into it, so please let me ask you a question.A.h#include<memory>class B;class A { public: static std::unique_ptr<A...

2 years ago

1 answers
149 views
0
Why does the cannot initialize object parameter for "some widgets" with an expression type 'MainWindow' occur?

We launched the mainwindow project in QtCreator 4.7Qt5.11.The pro file, the h file, and the cpp file are automatically created, but there is an error that does not make sense.mainwindow.cpp#include ma...


2 answers
147 views
0
Is it OK that the string of numbers generated by std::random_device is the same every time?

In the MinGW version of GCC, the default constructor of std::random_device generates the same numeric column every time, but is this behavior compliant with the standard?The implementation limitation ...

2 years ago

1 answers
89 views
0
int main(){([](){}()));} Why does it run normally?

I'm asking you a question because I saw such a strange code.I don't know why ([](){})()); is compiled normally in the source code belowI'm not a function pointer, I'm not an operator.But if you run it...


1 answers
93 views
0
What is std::move() used for?

The question I want to ask is std::move()This is.

2 years ago

1 answers
103 views
0
How to access std::map to auto?

std::vector<int> numbers = { 1, 2, 3, 4, 5, 6, 7 };for ( auto xyz : numbers ){ std::cout << xyz << std::endl;}In C++0x, vector for for if you turn the xyz door like this, int type w...

2 years ago
« - 2 - »

© 2024 OneMinuteCode. All rights reserved.