boost::static_assert name rationale ?

Hello, I have a rather silly question, but why is boost::static_assert named static_assert and not compile_assert ? It's probably a lack of understanding of the static concept on my side but I can't find what's static in a compile-time assertion :) Philippe

Philippe Vaucher wrote:
Hello,
I have a rather silly question, but why is boost::static_assert named static_assert and not compile_assert ? It's probably a lack of understanding of the static concept on my side but I can't find what's static in a compile-time assertion :)
According to my understanding, 'static' term is used to name compile-time operations, mostly in meta programming. It's similar distinction as between dynamic polymorphism (run-time, through virtual functions) and static polymorphism (compile-time, implemented with templates). Cheers -- Mateusz Loskot http://mateusz.loskot.net

--- Philippe Vaucher wrote:
Hello,
I have a rather silly question, but why is boost::static_assert named static_assert and not compile_assert ?
I think it's for consistency. Integral constants that are available at compile-time are declared as "static const". Regular compile-time typecasting is performed by static_cast. Boost currently has compile-time GCD and LCM algorithms called boost::math::static_gcd and boost::math::static_lcm, respectively. I'm sure someone out there has a deeper rationale, though. Cromwell D. Enage __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
participants (3)
-
Cromwell Enage
-
Mateusz Loskot
-
Philippe Vaucher