[mlpack-svn] [MLPACK] #155: order of includes and include protections

MLPACK Trac trac at coffeetalk-1.cc.gatech.edu
Mon Oct 31 15:52:33 EDT 2011


#155: order of includes and include protections
--------------------------------------------------+-------------------------
  Reporter:  nslagle                              |        Owner:     
      Type:  wishlist                             |       Status:  new
  Priority:  major                                |    Milestone:     
 Component:  MLPACK                               |   Resolution:     
  Keywords:  includes, templates, style, nitpick  |     Blocking:     
Blocked By:                                       |  
--------------------------------------------------+-------------------------

Comment (by nslagle):

 I suggested the additional protection to prevent direct inclusion
 altogether of ''do_stuff_ever_impl.hpp''; that is, a coder shouldn't ever
 directly include this header.  Using a single layer of protection doesn't
 guard against direct inclusion since, as you point out, they might include
 ''do_stuff_ever.hpp'' somewhere above, freeing them to directly include
 the ''_impl.hpp'' file even though they ought not.

 The extra layer forces a user to define an otherwise undefined macro
 before using it, at which point they'd see the prohibition statement in
 ''#error''.

-- 
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/155#comment:5>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed by the FASTLAB at Georgia Tech under Dr. Alex Gray.


More information about the mlpack-svn mailing list