Giter Club home page Giter Club logo

Comments (7)

haptork avatar haptork commented on May 18, 2024

The opinions on the SO link are quite differing. The most convincing to me is:

  • double quotes when giving relative path.
  • angle brackets when in include path.

There are opinions that say it helps distinguish system headers from library headers although I don't think this should be the case.

Is there anything more to it?

from easylambda.

elfring avatar elfring commented on May 18, 2024

I suggest to reconsider the consequences of the following wording from the section "16.2 Source file inclusion" in the standard specification for the programming language "C++".

…
The named source file is searched for in an implementation-defined manner. If this search is not supported, or if the search fails, the directive is reprocessed as if it read

#include <h-char-sequence> new-line
…

from easylambda.

haptork avatar haptork commented on May 18, 2024

I totally agree with using angular brackets in examples, tests and for any code that uses the library.

The confusion is for library headers. For e.g. ezl.hpp can have relative paths and double quotes or it can have angular brackets.

I think that its better to have angular brackets everywhere for consistency but just some clarification before going ahead. :)

from easylambda.

elfring avatar elfring commented on May 18, 2024

There are different opinions about the handling of the involved implementation-defined behaviour.

  • Will header files be also searched outside the specified include directories if double quotes are used for the discussed preprocessor statement?
  • Is there a speed difference measurable if a file is not found there and the search will be retried with "the angle brackets inclusion method"?
  • How do you think about to follow the inclusion style from the class library "Boost"?

from easylambda.

haptork avatar haptork commented on May 18, 2024

I just checked with Boost 1.54 that uses double quotes everywhere and 1.60 that uses angle brackets everywhere.

Commit for using angle brackets consistently everywhere.

from easylambda.

elfring avatar elfring commented on May 18, 2024

Thanks for your source code improvement.

from easylambda.

haptork avatar haptork commented on May 18, 2024

Thanks for the very useful suggestions and informative links.

from easylambda.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.