Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.52 KB

API.md

File metadata and controls

50 lines (34 loc) · 1.52 KB

lh-cpp API

C++ Flavour

These functions permit to set the C++ flavour currently used.

The typical use case of these functions is to adapt code snippets to best fit the idioms of the language, or to select the more standard type/function/construct available.

Examples

See for instance:

Functions

lh#cpp#get_flavour()

Returns: the current C++ flavour (03, 05, 11, 14, or 17)

The flavour is obtained from (bg)_cpp_std_flavour, $CXXFLAGS, or $CMAKE_CXXFLAGS.

lh#cpp#use_TR1()

Returns: whether TR1 (or more is supported).

This function checks lh#cpp#get_flavour() result >= '05'.

In order to check for TR1 and only TR1, test lh#cpp#use_TR1() & !lh#cpp#use_cpp11().

lh#cpp#use_cpp11()

Returns: whether C++11 (or more) is supported

This function relies on lh#cpp#get_flavour()

lh#cpp#use_cpp14()

Returns: whether C++14 (or more) is supported

This function relies on lh#cpp#get_flavour()

lh#cpp#use_cpp17()

Returns: whether C++17 (or more) is supported

This function relies on lh#cpp#get_flavour()

Tests

See tests/lh/test-flavours.vim.