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

stereomatchingkiss notifications at github.com
Wed Apr 13 04:05:46 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

I have different opinion about this one, I think it is reasonable to change it from const to constexpr because

1 : It may(not will) help the compiler generate better binary, smaller and faster
2 : It is not premature optimization, because changing from const to constexpr do not seem like adding any burden on the programmers

These are what I think about, just take it as reference.

---
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-209293655
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160413/3a75951c/attachment-0001.html>


More information about the mlpack-git mailing list