Questions tagged as 'c++11'

1
answer

How to create an object with class template?

I have this code: Main.cpp Warehouse<Base<int>> arm(1, 1, 1, 1); arm.createSubBase(1,1,1); Warehouse.h private: vector<Base<T>*> whouse; public : void createSubBase(int, int, int); template <class T> v...
asked by 25.10.2014 / 16:48
1
answer

Object Oriented Multithread in C ++ 11 Native?

How is Multithread Orientado a Objetos implemented in C++11 ? in java this is possible through the% Class extension Thread / Implementing the Runnable interface and overriding the Run method of both. In C++11 I...
asked by 01.06.2015 / 14:23
1
answer

Code for earlier than expected

Follow the code with my suspicions: Header: class Name_pairs { public: void read_names(); void read_ages(); void print() const; void sort(); // Ordenar os nomes com as idades private: std::vector<std::s...
asked by 30.06.2016 / 20:14
2
answers

Handling Exceptions in C ++

I have a question regarding the handling of exceptions in C ++, the class Fracao below is purposely incomplete does not even have setters or getters and several things were " left "side, has only two attributes and a constructor, and...
asked by 28.09.2016 / 01:26
1
answer

How to do sorting in classes?

The funny thing is that this was an answer! The problem I have is this: I have a Person class, which is initialized with a string, and it splits into a number and another string. After the class is mounted, I get an entire file and split it into...
asked by 30.03.2014 / 04:02
1
answer

How do I add a value to a struct vector, for example in some vector field, since it is from a struct

#include <iostream> #include <vector> using namespace std; struct dados { int pessoas; int consumo; }; int main() { int totalx=0, totaly=0; int n,x,y; vector<dados> info; //int cidade = 1; cout...
asked by 01.05.2018 / 17:43
1
answer

What is the noexcept keyword and when to use it?

What does keyword noexcept in C ++ and in what situation should it be used?     
asked by 07.07.2018 / 23:15
1
answer

Variable without initializing

I did a basic function of squaring (exercise of a book), and I use a variable named aux and use it to compute the square power value, but the compiler claims that aux does not is initialized, I would like to understand why and how...
asked by 14.01.2016 / 17:21
1
answer

Problem with operator overload

Errors occur when I pass the object of class Name_pairs by output operator << and comparator == . Header: class Name_pairs { public: void read_names(); void read_ages(); void pr...
asked by 01.07.2016 / 21:45
0
answers

Simulate a mouse click using X11

I'm trying to simulate a mouse click using the X11 library on linux. Using the xev command on the terminal I have the following outputs. For a real click: ButtonPress event, serial 32, synthetic NO, window 0x2c00001, root 0xdb, subw...
asked by 15.01.2018 / 03:51