Skip to content

Commit bba6d62

Browse files
committed
Merge branch 'develop'
* develop: test: Add more basic cases for image class (#423) test: Add virtual_2d_locator fixture; is_2d_traversable test case test: Check more properties of indexed_image_view from extension/toolbox test: Add basic is_1d_traversable cases for image_view chore: Update CMakeSettings.json sample [ci skip] chore: Update CMake to use latest cmake-conan/0.18.1 [ci skip] Add pmr image typedefs (#529) test: Add test cases for image with empty dimensions (#702) test: Case test_constructor_from_view was not called fix: Memory leak in image class for empty dimensions (#649) docs: Bump C++11 to C++14 as current required (#700) ci: Remove C++11 build jobs after C++14 switch (#698) build: Fix CMake source file extensions must be explicit refactor: Switch to trailing return types (#599) build: Bump Boost required by CMake from 1.72 to 1.80 build: Update CMAKE_CXX_STANDARD from 11 to 14
2 parents b29f3da + 2409be4 commit bba6d62

File tree

114 files changed

+1443
-713
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+1443
-713
lines changed

.appveyor.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
version: 1.0.{build}-{branch}
99

10-
# Current Boost.GIL develop branch (future Boost 1.68) requires C++11
10+
# Current Boost.GIL develop branch requires C++14
1111
# Since VS2017, MSVC default is /std:c++14, so no explicit switch is required.
1212
image: Visual Studio 2017
1313

@@ -17,18 +17,6 @@ shallow_clone: true
1717

1818
environment:
1919
matrix:
20-
- TOOLSET: msvc-14.0
21-
ARCH: x86_64
22-
VARIANT: debug
23-
CXXSTD: 11
24-
TEST_HEADERS: 1
25-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
26-
- TOOLSET: msvc-14.0
27-
ARCH: x86_64
28-
VARIANT: release
29-
CXXSTD: 11
30-
TEST_HEADERS: 1
31-
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
3220
- TOOLSET: msvc-14.1
3321
ARCH: x86_64
3422
VARIANT: debug

.ci/azure-pipelines/steps-cmake-build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
parameters:
88
# defaults, if not specified
99
configuration: 'Release'
10-
cxxver: '11'
10+
cxxver: '14'
1111
enable_ext_io: 'OFF'
1212
enable_ext_numeric: 'ON'
1313
enable_ext_toolbox: 'ON'

.github/workflows/ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,64 +19,64 @@ jobs:
1919
matrix:
2020
include:
2121
- toolset: gcc-6
22-
cxxstd: "11,14,1z"
22+
cxxstd: "14,1z"
2323
os: ubuntu-18.04
2424
install: g++-6
2525
- toolset: gcc-7
26-
cxxstd: "11,14,17"
26+
cxxstd: "14,17"
2727
os: ubuntu-18.04
2828
- toolset: gcc
2929
compiler: g++-8
30-
cxxstd: "11,14"
30+
cxxstd: "14"
3131
os: ubuntu-18.04
3232
install: g++-8
3333
- toolset: gcc-9
34-
cxxstd: "11,14,17"
34+
cxxstd: "14,17"
3535
os: ubuntu-18.04
3636
- toolset: gcc-10
37-
cxxstd: "11,14,17"
37+
cxxstd: "14,17"
3838
os: ubuntu-18.04
3939
- toolset: clang
4040
compiler: clang++-3.9
41-
cxxstd: "11,14"
41+
cxxstd: "14"
4242
os: ubuntu-18.04
4343
install: clang-3.9
4444
- toolset: clang
4545
compiler: clang++-4.0
46-
cxxstd: "11,14"
46+
cxxstd: "14"
4747
os: ubuntu-18.04
4848
install: clang-4.0
4949
- toolset: clang
5050
compiler: clang++-5.0
51-
cxxstd: "11,14,1z"
51+
cxxstd: "14,1z"
5252
os: ubuntu-18.04
5353
install: clang-5.0
5454
- toolset: clang
5555
compiler: clang++-6.0
56-
cxxstd: "11,14,17"
56+
cxxstd: "14,17"
5757
os: ubuntu-18.04
5858
install: clang-6.0
5959
- toolset: clang
6060
compiler: clang++-7
61-
cxxstd: "11,14,17"
61+
cxxstd: "14,17"
6262
os: ubuntu-18.04
6363
install: clang-7
6464
- toolset: clang
6565
compiler: clang++-8
66-
cxxstd: "11,14,17"
66+
cxxstd: "14,17"
6767
os: ubuntu-20.04
6868
install: clang-8
6969
- toolset: clang
7070
compiler: clang++-9
71-
cxxstd: "11,14,17"
71+
cxxstd: "14,17"
7272
os: ubuntu-20.04
7373
install: clang-9
7474
- toolset: clang
7575
compiler: clang++-10
76-
cxxstd: "11,14,17"
76+
cxxstd: "14,17"
7777
os: ubuntu-20.04
7878
- toolset: clang
79-
cxxstd: "11,14,17"
79+
cxxstd: "14,17"
8080
os: macos-10.15
8181

8282
runs-on: ${{matrix.os}}
@@ -129,7 +129,7 @@ jobs:
129129
addrmd: 32,64
130130
os: windows-2019
131131
- toolset: gcc
132-
cxxstd: "11,14,17"
132+
cxxstd: "14,17"
133133
addrmd: 64
134134
os: windows-2019
135135
- toolset: msvc-14.3

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Run tests
4444
run: |
4545
cd ../boost-root
46-
./b2 -j3 libs/$LIBRARY/test coverage=on toolset=gcc cxxstd=11 variant=debug
46+
./b2 -j3 libs/$LIBRARY/test coverage=on toolset=gcc cxxstd=14 variant=debug
4747
lcov --directory bin.v2 --capture --no-external --directory $(pwd) --output-file coverage.info > /dev/null 2>&1
4848
lcov --extract coverage.info $(pwd)'/boost/gil/*' --output-file coverage.info > /dev/null
4949
lcov --list coverage.info

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ target_link_libraries(boost_gil
3636
Boost::variant2
3737
)
3838

39-
target_compile_features(boost_gil INTERFACE cxx_std_11)
39+
target_compile_features(boost_gil INTERFACE cxx_std_14)
4040

4141
else()
4242

@@ -60,14 +60,14 @@ option(BOOST_GIL_ENABLE_EXT_RASTERIZATION "Enable Rasterization extension and te
6060
option(BOOST_GIL_ENABLE_EXT_IMAGE_PROCESSING "Enable Image Processing extension (!) and tests" ON)
6161
option(BOOST_GIL_USE_CONAN "Use Conan to install dependencies" OFF)
6262
option(BOOST_GIL_USE_CLANG_TIDY "Set CMAKE_CXX_CLANG_TIDY property on targets to enable clang-tidy linting" OFF)
63-
set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ standard version to use (default is 11)")
63+
set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ standard version to use (default is 14)")
6464

6565
#-----------------------------------------------------------------------------
6666
# Project
6767
#-----------------------------------------------------------------------------
6868
project(Boost.GIL
6969
LANGUAGES CXX
70-
DESCRIPTION "Boost.GIL - Generic Image Library | Requires C++11 since Boost 1.68")
70+
DESCRIPTION "Boost.GIL - Generic Image Library | Requires C++14 since Boost 1.80")
7171

7272
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR}/cmake)
7373

@@ -140,7 +140,7 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
140140
set(Boost_USE_STATIC_RUNTIME OFF)
141141
endif()
142142

143-
find_package(Boost 1.72.0 REQUIRED COMPONENTS filesystem)
143+
find_package(Boost 1.80.0 REQUIRED COMPONENTS filesystem)
144144
message(STATUS "Boost.GIL: Using Boost_INCLUDE_DIRS=${Boost_INCLUDE_DIRS}")
145145
message(STATUS "Boost.GIL: Using Boost_LIBRARY_DIRS=${Boost_LIBRARY_DIRS}")
146146

@@ -161,7 +161,7 @@ if(BOOST_GIL_USE_CONAN)
161161
# Download automatically, you can also just copy the conan.cmake file
162162
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
163163
message(STATUS "Boost.GIL: Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
164-
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.15/conan.cmake"
164+
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
165165
"${CMAKE_BINARY_DIR}/conan.cmake")
166166
endif()
167167

CONTRIBUTING.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ please follow the workflow explained in this document.
2424

2525
## Prerequisites
2626

27-
- C++11 compiler
27+
- C++14 compiler
2828
- Build and run-time dependencies for tests and examples:
2929
- Boost.Filesystem
3030
- Boost.Test
@@ -359,25 +359,25 @@ Run core tests only specifying location of directory with tests:
359359
360360
```shell
361361
cd libs/gil
362-
b2 cxxstd=11 test/core
362+
b2 cxxstd=14 test/core
363363
```
364364
365365
Run all tests for selected extension (from Boost root directory, as alternative):
366366
367367
```shell
368-
b2 cxxstd=11 libs/gil/test/extension/dynamic_image
369-
b2 cxxstd=11 libs/gil/test/extension/io
370-
b2 cxxstd=11 libs/gil/test/extension/numeric
371-
b2 cxxstd=11 libs/gil/test/extension/toolbox
368+
b2 cxxstd=14 libs/gil/test/extension/dynamic_image
369+
b2 cxxstd=14 libs/gil/test/extension/io
370+
b2 cxxstd=14 libs/gil/test/extension/numeric
371+
b2 cxxstd=14 libs/gil/test/extension/toolbox
372372
```
373373
374374
Run I/O extension tests bundled in target called `simple`:
375375
376376
```shell
377-
b2 cxxstd=11 libs/gil/test/io//simple
377+
b2 cxxstd=14 libs/gil/test/io//simple
378378
```
379379
380-
**TIP:** Pass `b2` feature `cxxstd=11,14,17,2a` to request compilation for
380+
**TIP:** Pass `b2` feature `cxxstd=14,17,2a` to request compilation for
381381
multiple C++ standard versions in single build run.
382382
383383
### Using CMake
@@ -405,17 +405,17 @@ The provided CMake configuration allows a couple of ways to develop Boost.GIL:
405405
406406
For CMake, you only need to build Boost libraries required by Boost.Test library
407407
which is used to run GIL tests. Since the `CMAKE_CXX_STANDARD` option in the current
408-
[CMakeLists.txt](CMakeLists.txt) defaults to C++11, pass the default `cxxstd=11` to `b2`:
408+
[CMakeLists.txt](CMakeLists.txt) defaults to C++14, pass the default `cxxstd=14` to `b2`:
409409
410410
```shell
411411
./b2 headers
412-
./b2 variant=debug,release cxxstd=11 --with-filesystem stage
412+
./b2 variant=debug,release cxxstd=14 --with-filesystem stage
413413
```
414414
415415
or, depending on specific requirements, more complete build:
416416
417417
```shell
418-
./b2 variant=debug,release address-model=32,64 cxxstd=11 --layout=versioned --with-filesystem stage
418+
./b2 variant=debug,release address-model=32,64 cxxstd=14 --layout=versioned --with-filesystem stage
419419
```
420420
421421
If you wish to build tests using different C++ standard version, then adjust the `cxxstd` accordingly.
@@ -447,50 +447,52 @@ Here is an example of such lightweight workflow in Linux environment (Debian-bas
447447
- Configure build with CMake
448448
449449
```shell
450-
mkdir _build
451-
cd _build/
452-
cmake ..
450+
cmake -S . -B _build -DBoost_ADDITIONAL_VERSIONS=1.80 -DBoost_COMPILER=-gcc11 -DBoost_ARCHITECTURE=-x64
453451
```
454452
455-
**TIP:** By default, tests and [examples](example/README.md) are compiled using
456-
the minimum required C++11.
457-
Specify `-DCMAKE_CXX_STANDARD=14|17|20` to use newer version.
453+
By default, tests and [examples](example/README.md) are compiled using
454+
the minimum required C++14.
455+
Specify `-DCMAKE_CXX_STANDARD=17|20` to use newer version.
458456
For more CMake options available for GIL, check `option`-s defined
459457
in the top-level `CMakeLists.txt`.
460458
461-
**TIP:** If CMake is failing to find Boost libraries, especially built
462-
with `--layout=versioned`, you can try a few hacks:
463-
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
464-
add an architecture tag to the library file names in versioned build
465-
The option added in CMake 3.13.0.
459+
CMake is failing to find Boost libraries, especially built with `--layout=versioned`,
460+
you can try a few hacks as displayed in the command above:
466461
- option `-DBoost_COMPILER=-gcc5` or `-DBoost_COMPILER=-vc141` to help CMake earlier
467462
than 3.13 match your compiler with toolset used in the Boost library file names
468463
(i.e. `libboost_filesystem-gcc5-mt-x64-1_69` and not `-gcc55-`).
469464
Fixed in CMake 3.13.0.
465+
- option `-DBoost_ARCHITECTURE=-x64` to help CMake find Boost 1.66 and above
466+
add an architecture tag to the library file names in versioned build
467+
The option added in CMake 3.13.0.
468+
- option `-DDBoost_ADDITIONAL_VERSIONS=<unreleased Boost version>` is especially usefull
469+
when testing GIL with staged build of Boost from its `develop` branch.
470470
- if CMake is still failing to find Boost, you may try `-DBoost_DEBUG=ON` to
471471
get detailed diagnostics output from `FindBoost.cmake` module.
472472
473473
- List available CMake targets
474474
475475
```shell
476-
cmake --build . --target help
476+
cmake --build _build --target help
477477
```
478478
479479
- Build selected target with CMake
480480
481481
```shell
482-
cmake --build . --target gil_test_pixel
482+
cmake --build _build --target gil_test_pixel
483483
```
484484
485485
- List available CTest targets
486486
487487
```shell
488+
cd __build
488489
ctest --show-only | grep Test
489490
```
490491
491492
- Run selected test with CTest
492493
493494
```shell
495+
cd __build
494496
ctest -R gil.tests.core.pixel
495497
```
496498
@@ -567,10 +569,10 @@ Thus, below a few basic guidelines are listed.
567569
First and foremost, make sure you are familiar with the official
568570
[Boost Library Requirements and Guidelines](https://www.boost.org/development/requirements.html).
569571
570-
Second, strive for writing idiomatic C++11, clean and elegant code.
572+
Second, strive for writing idiomatic C++14, clean and elegant code.
571573
572574
**NOTE:** *The Boost.GIL source code does not necessary represent clean and elegant
573-
code to look up to. The library has recently entered the transition to C++11.
575+
code to look up to. The library has recently entered the transition to C++14.
574576
Major refactoring overhaul is ongoing.*
575577
576578
Maintain structure your source code files according to the following guidelines:

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Documentation | GitHub Actions | AppVeyor | Azure Pipelines | Regression | Codec
2929

3030
Boost.GIL is a part of the [Boost C++ Libraries](http://github.com/boostorg).
3131

32-
The Boost Generic Image Library (GIL) is a **C++11** header-only library that abstracts image
32+
The Boost Generic Image Library (GIL) is a **C++14** header-only library that abstracts image
3333
representations from algorithms and allows writing code that can work on a
3434
variety of images with performance similar to hand-writing for a specific image type.
3535

@@ -52,11 +52,9 @@ See [example/cmake/README.md](example/cmake/README.md) for CMake configuration e
5252

5353
## Requirements
5454

55-
**NOTE:** The library source code is currently being modernized for C++11.
56-
5755
The Boost Generic Image Library (GIL) requires:
5856

59-
- C++11 compiler (GCC 4.9, clang 3.3, MSVC++ 14.0 (1900) or any later version)
57+
- C++14 compiler (GCC 6, clang 3.9, MSVC++ 14.1 (1910) or any later version)
6058
- Boost header-only libraries
6159

6260
Optionally, in order to build and run tests and examples:

conanfile.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2018-2021 Mateusz Loskot <mateusz at loskot dot net>
2+
# Copyright (c) 2018-2022 Mateusz Loskot <mateusz at loskot dot net>
33
#
44
# Distributed under the Boost Software License, Version 1.0.
55
# (See accompanying file LICENSE_1_0.txt or copy at
@@ -11,4 +11,5 @@ libpng/1.6.37
1111
libtiff/4.1.0
1212

1313
[generators]
14-
cmake
14+
CMakeDeps
15+
CMakeToolchain

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Boost Generic Image Library
22
===========================
33

4-
The Generic Image Library (GIL) is a C++11 header-only library that abstracts image
4+
The Generic Image Library (GIL) is a C++14 header-only library that abstracts image
55
representations from algorithms and allows writing code that can work on
66
a variety of images with performance similar to hand-writing for a specific
77
image type.

doc/installation.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ Compiling
2020
---------
2121

2222
The Boost.GIL library source code should successfully compile with any
23-
compiler with complete C++11 support.
23+
compiler with complete C++14 support.
2424

2525
.. note::
2626

27-
We are planning to drop support for require C++14 support in Boost 1.76 or later,
28-
or selectively drop support for GCC 5 due to its issues with inheriting constructors,
29-
see `discussion for PR #526 <https://github.com/boostorg/gil/pull/526>`_.
27+
Boost.GIL requires C++14 compiler since ince Boost 1.80.
3028

3129
For the actual list of currently tested compilers, check results of the library CI
3230
builds linked from the `README.md <https://github.com/boostorg/gil/blob/develop/README.md>`_

0 commit comments

Comments
 (0)