[LLVMdev] Explicit constructors with more than one argument
chandlerc at google.com
Sat Mar 14 22:51:24 PDT 2015
On Sat, Mar 14, 2015 at 10:26 PM, Gabriel Dos Reis <
gdr at integrable-solutions.net> wrote:
> Some LLVM classes (e.g. ReturnInst) have explicit constructors with at
> least two parameters (with no default arguments). Why is that? E.g. what
> are they trying to prevent?
> -- Gaby
FWIW, I suspect that it is mostly an accident (IE, one of the arguments was
added without removing the explicit or a default was removed, etc.)
However, there are good reasons for this in C++11 -- making constructors
explicit prevents them from being called in return statements like "return
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev