Questions tagged as 'c++11'

1
answer

What's the difference between declaring a variable like constexpr const and constexpr?

What's the difference between declaring a constant as constexpr const to only a constexpr ? constexpr const float max_height = 3.0f; constexpr float max_height = 3.0f;     
asked by 29.09.2018 / 20:39
1
answer

How to walk through a set with inserted data?

I have a program that inserts some integers into a set, and removes when I find an equal, after doing so, I need to bring in the output all integers that are still inside the set, however I am not able to do set and bring the information I want....
asked by 14.10.2018 / 01:16
1
answer

Execute commands in a string in C ++

I have commands in a string something like: string comm = "int x; cout << \"Digite um número\"; cin << x;"; My idea is to execute the commands that are in this string , having the result as if I had typed: int x cout <&l...
asked by 16.07.2017 / 02:47
1
answer

How to create a mapped file with a std :: map

I'm trying to use a std :: map that allocates objects within a mapped file using boost, with a vector worked but with a non map #include <boost/interprocess/managed_mapped_file.hpp> #include <map> #include <iostream> namespac...
asked by 11.07.2017 / 16:17
1
answer

Search for text in a String as a "like"

I want to do a text search, like the ones I do in MySQL. Ex: LIKE "9% 4" I tried to implement a find_if() , but without success. #include <iostream> #include <string> #include <algorithm> using namespace std; int m...
asked by 12.07.2016 / 09:44
1
answer

Is it possible to create a std :: list with an initializer_list?

I'd like to pass a temporary std::list to a function, but I do not know if it's possible to do so. I know it is possible to pass% temporary% with std::vector : #include <iostream> #include <vector> template<typenam...
asked by 11.09.2014 / 21:18
1
answer

How to use a constructor with two or more classes?

I'm developing an orientation-to-object library. I've created an iterator for my future container. I have advance_iterator and regress_iterator . Both give bidirectional_iterator . The code is: #ifndef OBJSTD_ADVANCE_ITERATO...
asked by 19.06.2014 / 04:04
1
answer

Get result of an expression in c ++

I'm almost finishing my expression interpreter. But I have no idea how to do the most important part: The result I would learn a lot from any idea. main.cpp #include <string> #include <iostream> #include <fstream> #incl...
asked by 20.06.2018 / 03:18
1
answer

How to define a subclass of an abstract class so that it is concrete

With these classes: class SerVivo { public: virtual void funcA() = 0; virtual void funcB() = 0; }; class Vegetal : public SerVivo{ public: virtual void funcB(){ cout << "funcB em Vegetal \n"; } virtual void funcC() = 0; };...
asked by 20.02.2018 / 13:43
0
answers

how to traverse a pointer to set in c ++?

Hello, I'm implementing the Kruskal algorithm, but I can not walk through set< No*>* to test the FIND_SET method, which is a set< No*>* how should I proceed? (in the rest of the code I was running set with foreach...
asked by 13.11.2017 / 16:53