In addition to that, YouCompleteMe supports custom configuration via python and supports the loading of compilation_database.json to load the appropriate compile flags for each file.
It does have some issues on Windows due to the NTFS filesystem, which incidentally also happens with other IDEs using libclang for code completion. The issue being that libclang keeps the file compilation_database.json open and thus your build might fail because it is in use. The workaround to is to run ":YcmRestartServer" before you build, or write some python code to deal with this issue.
Because of an issue with libclang, saving implementation headers (headers included at the end of another header) will end up in vim telling you it's write protected, simply use ":YcmRestartServer" and save.
Edit: A good starting point for your YCM python configuration is the .ycm_extra_conf.py from YCM itself: https://github.com/Valloric/ycmd/...dabda5/cpp/ycm/.ycm_extra_conf.py