[cfe-dev] Refactoring internal CXString APIs

Jacob Carlborg doob at me.com
Mon Jan 28 01:42:28 PST 2013


On 2013-01-28 10:01, Csaba Raduly wrote:

> This just proves that boolean parameters make the code harder to read.
> Furthermore:
>
> http://martinfowler.com/bliki/FlagArgument.html
> http://silkandspinach.net/2004/07/15/avoid-boolean-parameters/
> http://blog.ometer.com/2011/01/20/boolean-parameters-are-wrong/

Without having read those links an enum parameter could be used instead:

enum class DupString { no, yes };

createCXString(Cmd->CommandLine[Arg].c_str(), DupString::no);

-- 
/Jacob Carlborg




More information about the cfe-dev mailing list