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

stereomatchingkiss notifications at github.com
Tue Apr 12 16:56:40 EDT 2016


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

Don't worry, const could be removed, unlike constexpr function, constexpr variable must be able to evaluate at compile time(as I remember).

example : 

    constexpr double log2pi = 3.14159;
    log2pi = 3.14; //compile time error

I will add the static back to the variable, this should make sure the variable can be evaluated at compile time and would not recreate every time.

---
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-209098646
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160412/6a809b8b/attachment-0001.html>


More information about the mlpack-git mailing list