Search found 78 matches
- May 22nd, 2020, 1:19 pm
- Forum: Everything
- Topic: includes usage ?
- Replies: 6
- Views: 3134
Re: includes usage ?
What do you mean by "system includes"? in general include to sources that are external to your program : in general in the form <header.h>, but can be boost, sfml, or anything external, that you do not control. Something I've done is comment out all the headers and uncomment one by one to see which...
- May 22nd, 2020, 7:06 am
- Forum: Everything
- Topic: includes usage ?
- Replies: 6
- Views: 3134
includes usage ?
Hi guys, as my code is getting bigger, I would like to know if there is a common usage concerning includes ? Especially: is it ok to put system includes in my own .h, or should I clear my .h from any include and put includes only in .cpp ? Because now, I have system includes a little bit everywhere,...
- May 20th, 2020, 7:52 pm
- Forum: Everything
- Topic: map::emplace with multiple parameter constructor ?
- Replies: 12
- Views: 9328
Re: map::emplace with multiple parameter constructor ?
@albi: you like to play with the theory, uh ? are you a professional programmer, or maybe working on the computer research side ? @slidy : you make me doubt. I was sure that the addition of this constructor was doubling the emplace implicit constructor. They say : "This new element is constructed in...
- May 17th, 2020, 8:16 pm
- Forum: Everything
- Topic: map::emplace with multiple parameter constructor ?
- Replies: 12
- Views: 9328
Re: map::emplace with multiple parameter constructor ?
hi guys, as I said in my original post, I tried the map.emplace(12, A(2.5,3.5)) option, but I wish there was an option to avoid it, because it calls a temporary constructor/copy. Emplace is supposed to avoid that as specified in the doc... But I'll do this. PS: I also saw the forward_as_tuple versio...
- May 17th, 2020, 12:46 pm
- Forum: Everything
- Topic: map::emplace with multiple parameter constructor ?
- Replies: 12
- Views: 9328
map::emplace with multiple parameter constructor ?
Hi, trying to use map::emplace() with a multiple parameters constructor.... like this : class A { A(int _a, int _b) : a(_a), b(_b) {}; float a, b; } std::multimap<int,A> map; map.emplace(12, 2.5,3.5); does not work... he tries to find a constructor with 3 members, as if he was ignoring the first par...
- May 17th, 2020, 12:36 pm
- Forum: Everything
- Topic: functor accessing class members ?
- Replies: 4
- Views: 2649
Re: functor accessing class members ?
Ok thanks man, I did not read enough about the [] part !!!
- May 17th, 2020, 12:35 pm
- Forum: Everything
- Topic: VC++ 2019 and lib subdir path ?
- Replies: 6
- Views: 3361
Re: VC++ 2019 and lib subdir path ?
Yes, I love headers lib.
Boost claims to be one of them, but infact, some parts of boost needs cpp and compilation and link.
Boost claims to be one of them, but infact, some parts of boost needs cpp and compilation and link.
- May 16th, 2020, 8:23 pm
- Forum: Everything
- Topic: functor accessing class members ?
- Replies: 4
- Views: 2649
functor accessing class members ?
Hi there, I just discover functors and I'd like to use them as functions into functions, to reduce the scope of these subfunctions, as little local swiss knifes. What I would like to do is something like this : class A { void f(); int x; } void A::f() { auto g = []() { x *= 2; } g(); } he says : "an...
- May 16th, 2020, 8:14 pm
- Forum: Everything
- Topic: VC++ 2019 and lib subdir path ?
- Replies: 6
- Views: 3361
Re: VC++ 2019 and lib subdir path ?
So I understand that you are voting for static link
I must have a look at this and see how it can be done with SFML.
I must have a look at this and see how it can be done with SFML.
- May 12th, 2020, 6:48 am
- Forum: Everything
- Topic: local static or not ?
- Replies: 5
- Views: 3368
Re: local static or not ?
Ok; thanks, so my first idea was not good. It seems that it would be "lighter" to create classic local variables on the stack.