[mlpack-git] [mlpack/mlpack] use constexpr to replace static const (#612)

Marcus Edel notifications at github.com
Tue Apr 12 16:19:31 EDT 2016


I think, it would be reasonable to use constexpr if the initialization is time-consuming at runtime or if we could evaluate an expression at compile time. But that's not the case here, anyway I think what we could do here is to use ```static constexpr``` as we do it with ```log2pi``` in ```gaussian_distribution.hpp```.

```
static const constexpr double log2pi = 1.83787706640934533908193770912475883;
```

I'm almost sure the first const is obsolete, I'll need to check that.

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/612#issuecomment-209086788
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160412/959f72f3/attachment-0001.html>


More information about the mlpack-git mailing list