Skip to content

Commit

Permalink
libint2::any fixed, bump to 2.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
evaleev committed May 3, 2017
1 parent e5f0187 commit c833815
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
5 changes: 4 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@

Following is a brief summary of changes made in each release of Libint.

- 2017-xx-yy: 2.4.0
- 2017-xx-yy: 2.3.2
-

- 2017-05-03: 2.3.1
- minor fixes to libint2::any

- 2017-05-02: 2.3.0
- bumped the compiler source license to GPLv3, generated code is LGPLv3.
- replaced non-standard-conforming libint2::any with a homegrown C++17-conforming any;
Expand Down
6 changes: 3 additions & 3 deletions CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ If you publish results using LIBINT, please cite it using:

An unmodified standard release:

Libint: A library for the evaluation of molecular integrals of many-body operators over Gaussian functions, Version 2.3.0
Libint: A library for the evaluation of molecular integrals of many-body operators over Gaussian functions, Version 2.3.1
Edward F. Valeev, http://libint.valeyev.net/ .

A modified release:

Libint: A library for the evaluation of molecular integrals of many-body operators over Gaussian functions, Version 2.3.0
Libint: A library for the evaluation of molecular integrals of many-body operators over Gaussian functions, Version 2.3.1
Edward F. Valeev, http://libint.valeyev.net/ . Modified by An Author, institution, location, year.

The literature citation in bibtex format is:
Expand All @@ -18,7 +18,7 @@ The literature citation in bibtex format is:
author = "E.~F.~Valeev",
title = “Libint: A library for the evaluation of molecular integrals of many-body operators over Gaussian functions",
howpublished = "http://libint.valeyev.net/",
note = "version 2.3.0",
note = "version 2.3.1",
year = 2017
}

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([libint_mmm_version],[2.3.0])
define([libint_mmm_version],[2.3.1])
define([libint_buildid],[])
define([libint_so_version],[2:2:0])

Expand Down
2 changes: 1 addition & 1 deletion export/configure.export
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define([libint_mmm_version],[2.3.0])
define([libint_mmm_version],[2.3.1])
define([libint_buildid],[])
define([libint_so_version],[2:2:0])

Expand Down
18 changes: 14 additions & 4 deletions include/libint2/util/any.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,23 @@ namespace libint2 {
#if __cplusplus >= 201703L
using std::any;
#else

namespace detail {
// true if decayed T is Base, or is derived from it
template <typename Base, typename T>
using disable_if_same_or_derived = typename std::enable_if<
!std::is_base_of<Base, typename std::decay<T>::type>::value>::type;
};

/// a partial C++17 std::any implementation (and less efficient than can be)
class any {
public:
// this is constexpr in the standard
any() : impl_(nullptr) {}
any(const any& other) : impl_(other.impl_->clone()) {}
any(any&& other) = default;
template <class ValueType>
template <typename ValueType,
typename = detail::disable_if_same_or_derived<any, ValueType> >
any(ValueType&& value)
: impl_(new impl<typename std::decay<ValueType>::type>(
std::forward<ValueType>(value))) {}
Expand All @@ -54,9 +63,10 @@ class any {
impl_ = std::move(rhs.impl_);
return *this;
}
template<typename ValueType>
any& operator=( ValueType&& rhs ) {
impl_ = decltype(impl_)(new impl<typename std::decay<ValueType>::type> (
template <typename ValueType,
typename = detail::disable_if_same_or_derived<any, ValueType> >
any& operator=(ValueType&& rhs) {
impl_ = decltype(impl_)(new impl<typename std::decay<ValueType>::type>(
std::forward<ValueType>(rhs)));
return *this;
}
Expand Down

0 comments on commit c833815

Please sign in to comment.