« first day (878 days earlier)      last day (1975 days later) » 

7:24 AM
@nwp hello, could you help me about this question, which is about threads? stackoverflow.com/q/53646052/7813604
 
 
7 hours later…
2:01 PM
Hey all, I have a simple question: can anyone tell me why `char const* != T` in the cases 4 and 5 listed in [this answer](https://www.stackoverflow.com/a/26861516) ? Specifically, he says that: "In other words, if called with one argument of type T, be it an rvalue or lvalue, emplace_back and push_back are equivalent.

However, for any other argument(s), emplace_back wins the race, for example with a char const* in a vector<string>:"
my question how do they specify T exactly?
why does chat const* fall into the category of other arguments?
 
in this context, T is referring to std::vector<T>::value_type
and the question asks for std::vector<std::string>, so T is std::string in the context of the question
 
 
1 hour later…
3:06 PM
@milleniumbug not sure if I got this right, but does that mean emplace_back is more advantageous if you use types that are convertible to T in vector<T> (provided T has the corresponding constructor(s) that take(s) T-convertible arguments)?
 
 
1 hour later…
4:33 PM
@milleniumbug so why can't T be equal to char const*?
I just wrote the following code and it worked:
vector<char const*>::value_type a = "abc";
cout << a; // abc as expected
 
@GaurangTandon It can. But the question doesn't have T being char const*
It has T being std::string
 
Ooohhh...so he's maintaining that vector<string> example from the first three points onto the last two points as well
got it...thanks!
 
> However, for any other argument(s), emplace_back wins the race, for example with a char const* in a vector<string>:
> for example with a char const* in a vector<string>:
 
oh ok, my bad, i missed that for example :'(

so basically if we have vector<T> and we try to feed it data of another type, emplace_back wins, doesn't it?
 
@GaurangTandon if this other type can be passed to a T constructor, (I think)
 
4:42 PM
@MiroslavCetojevic yeah that too
thanks!
 
 
7 hours later…
11:13 PM
I could use some help linking with an external library in Visual Studio. I managed to link with a Boost library successfully in the past, but this time the library is one I wrote, so I'm not sure even whether the problem is with the library or with the settings in the project that's trying to use it.
I made a solution, set the configuration type to static library in the property pages, and compiled it. It should be possible to include any header file from this library in another solution if I adjust the settings of the solution properly, right?
 
11:26 PM
if I create a vector called O= ['a','b','c','d','e'], and I create a new vector from O
using rbegin and rend vector<string>(O.rbegin(), O.rend()). What's happening here?
 

« first day (878 days earlier)      last day (1975 days later) »