D
D
Daniil Demidko2016-10-25 10:04:46
C++ / C#
Daniil Demidko, 2016-10-25 10:04:46

Windows development - MSVC or TDM GCC (MinGW)?

Until recently, I used CodeLite + TDM GCC and was happy with everything.
But, having tried (we are talking about pure C ++, of course), Visual Studio was pleasantly surprised by the power of this IDE.
The only thing that worries me is the quality of MSVC Studio.
Often heard that it is not fully compliant with C++14.
When transferring a couple of projects to it, I immediately noticed the difference:
1) Different content of the same headers
For example, in TDM GCC operator >>for std::istreamand already comes with (somewhere inside its includes). In the studio you need to connect . 2) MSVC quietly compiles something likestd::string<iostream>
<string>

std::cout<<std::string(
std::istream_iterator<char>(
std::ifstream("CppExpr.vcxproj")), std::istream_iterator<char>());
(MinGW throws an error) but does not compile the code unless a non-void function returns a value (MinGW compiles).
3) Using list-initialization for structures (POD) with already pre-initialized fields:
struct Point {
    int X = 0;
    int Y = 0;
};
Point A { 1, 2 };

Here MinGW with -std=c++14 will compile the code, but MSVC will not.
4) And of course MSVC runtime.
I don't even know if that's good or bad.
In general, I ask, based on real experience, to tell me which of the compilers will be better.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mercury13, 2016-10-25
@Daniro_San

3) Using list-initialization for structures (POD) with already pre-initialized fields:

This is C++11. Good deal. MinGW supported while the standard was still being developed. MSVC started, but abandoned and brought to the end already in 2015 !!
Doesn't deviate from the standard.
MSVC is wrong, so it is forbidden to pass a non-constant reference.
Good diagnostic, but it's just a warning, not an error. It is difficult for the compiler to know whether a certain way of executing code is possible.

G
GavriKos, 2016-10-25
@GavriKos

Connect MinGW with its headers to the studio and everything will be as it was.

A
Anton Zhilin, 2016-10-25
@Anton3

Try VS 15 Preview -- not to be confused with 2015. As far as I know, C++14 is pretty well supported there. Naturally, in order for the code to compile under both msvc and gcc, you often have to put in a lot of effort. In this regard, nothing is going to change.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question