Skip to content

Commit

Permalink
Merge branch 'hotfix/0.20.2'
Browse files Browse the repository at this point in the history
* hotfix/0.20.2:
  Version 0.20.2
  ATLAS-274 Fix 100ds of warnings
  • Loading branch information
wdeconinck committed Apr 27, 2020
2 parents b9360f5 + 83d70d4 commit 9fe11e8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

## [Unreleased]

## [0.20.2] - 2019-04-27
### Fixed
- Avoid 100ds of compilation warnings introduced in version 0.20.0

## [0.20.1] - 2019-04-08
### Fixed
- Make feature BOUNDSCHECKING work again. It was not turned on for DEBUG builds
Expand Down Expand Up @@ -185,6 +189,7 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
## 0.13.0 - 2018-02-16

[Unreleased]: https://github.com/ecmwf/atlas/compare/master...develop
[0.20.2]: https://github.com/ecmwf/atlas/compare/0.20.1...0.20.2
[0.20.1]: https://github.com/ecmwf/atlas/compare/0.20.0...0.20.1
[0.20.0]: https://github.com/ecmwf/atlas/compare/0.20.0...0.19.2
[0.19.2]: https://github.com/ecmwf/atlas/compare/0.19.1...0.19.2
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.1
0.20.2
17 changes: 11 additions & 6 deletions src/atlas/array/LocalView.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ namespace array {

template <typename Value, int Rank>
class LocalView {
#define ENABLE_IF_CONST \
template <bool EnableBool = true, \
typename std::enable_if<( std::is_const<Value>::value && EnableBool ), int>::type* = nullptr>
#define ENABLE_IF_NON_CONST \
template <bool EnableBool = true, \
typename std::enable_if<( !std::is_const<Value>::value && EnableBool ), int>::type* = nullptr>

public:
// -- Type definitions
using value_type = Value;
Expand Down Expand Up @@ -152,6 +159,7 @@ class LocalView {

using non_const_value_type = typename std::remove_const<Value>::type;

ENABLE_IF_CONST
operator const LocalView<non_const_value_type, Rank>&() const {
return (const LocalView<non_const_value_type, Rank>&)( *this );
}
Expand Down Expand Up @@ -204,10 +212,6 @@ class LocalView {

bool contiguous() const { return ( size_ == shape_[0] * strides_[0] ? true : false ); }

#define ENABLE_IF_NON_CONST \
template <bool EnableBool = true, \
typename std::enable_if<( !std::is_const<Value>::value && EnableBool ), int>::type* = nullptr>

ENABLE_IF_NON_CONST
void assign( const value_type& value );

Expand Down Expand Up @@ -287,9 +291,10 @@ class LocalView {
idx_t size_;
idx_t shape_[Rank];
idx_t strides_[Rank];

#undef ENABLE_IF_CONST
#undef ENABLE_IF_NON_CONST
};

} // namespace array
} // namespace atlas

#undef ENABLE_IF_NON_CONST
1 change: 1 addition & 0 deletions src/atlas/array/gridtools/GridToolsArrayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class ArrayView {
// TODO: check compatibility
}

ENABLE_IF_CONST
operator const ArrayView<non_const_value_type, Rank>&() const {
return *(const ArrayView<non_const_value_type, Rank>*)( this );
}
Expand Down
1 change: 1 addition & 0 deletions src/atlas/array/native/NativeArrayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class ArrayView {
}
#endif

ENABLE_IF_CONST
operator const ArrayView<non_const_value_type, Rank>&() const {
return *(const ArrayView<non_const_value_type, Rank>*)( this );
}
Expand Down

0 comments on commit 9fe11e8

Please sign in to comment.