|Re: [eigen] Interesting C++ standard proposal|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Interesting C++ standard proposal
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Mon, 11 Nov 2013 22:17:49 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=x5SKd45fDPMheKaDgcAuANUd1ZrctrDaTbIkz/yQOmI=; b=d8AXeHMBErLp4yryfdGzE51mH2/DQkzC1jVehRK7iGL2cGmQsFAto2USxTilRhnsFL 0uh4GJ3EYTtVKE9cfZOk/EcITPwnw+VIAtK2dEGf8MvoBOidbZkI62N2PYlKrC/UH5oq 7eCD4SBDQH8ODItu/KsqUjviJlqTZ9oFVkGNssIkw8vJj3xatakRN17H/0i/cSsEX89H 9HEmr//nRCd4dOXZkk1P8V3RpizmOMFDVBYgQ/YAZHInrsT3Q7d3BW70GGMmvMoSK4zK U7373mCuzFZVXg6YaLC+B+GXEntBUGy5PWyDkw2LqCc5IumpKlJywoKKo6QUzUjRYWKR s2Yw==
in my opinion changing the behavior of auto by guessing what the user want to have when writing auto is a bit far fetched. Codes that make use of the auto keyword are often more difficult to read and debug. This proposal will make thing even worse because it will be even more difficult to guess what is the actual type of an auto variable. Users should be educated to use the auto keyword only when writing the actual type explicitly is really difficult. An Eigen _expression_ is a typical case. Writing 'auto' when one want a MatrixXd is ridiculous. Anyway, once bug 99 is finalized the use of auto with Eigen will be much clearer:
auto xpr = A+B*(C-2*D).cwisePow(2);
auto mat = (A+B*(C-2*D).cwisePow(2)).eval();
xpr will be a pure abstract _expression_
mat will be an object with storage holding the result of the _expression_.
Good enough for me.
Having the possibility to disable auto for some given types would be nice through.