Skip to content

Commit

Permalink
Merge d36ee74 into 41063a6
Browse files Browse the repository at this point in the history
  • Loading branch information
lballabio committed Mar 14, 2022
2 parents 41063a6 + d36ee74 commit 42bff33
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 46 deletions.
7 changes: 5 additions & 2 deletions ql/math/curve.hpp
Expand Up @@ -29,8 +29,11 @@

namespace QuantLib {

//! abstract curve class
class Curve {
/*! \deprecated To be removed as unused.
Copy it in your codebase if you need it.
Deprecated in version 1.26.
*/
class QL_DEPRECATED Curve {
public:
typedef Real argument_type;
typedef Real result_type;
Expand Down
11 changes: 7 additions & 4 deletions ql/math/lexicographicalview.hpp
Expand Up @@ -29,12 +29,12 @@

namespace QuantLib {

//! Lexicographical 2-D view of a contiguous set of data.
/*! This view can be used to easily store a discretized 2-D function
in an array to be used in a finite differences calculation.
/*! \deprecated To be removed as unused.
Copy it in your codebase if you need it.
Deprecated in version 1.26.
*/
template <class RandomAccessIterator>
class LexicographicalView {
class QL_DEPRECATED LexicographicalView {
public:
//! attaches the view with the given dimension to a sequence
LexicographicalView(const RandomAccessIterator& begin,
Expand Down Expand Up @@ -81,6 +81,8 @@ namespace QuantLib {

// inline definitions

QL_DEPRECATED_DISABLE_WARNING

template <class RandomAccessIterator>
inline
LexicographicalView<RandomAccessIterator>::LexicographicalView(
Expand Down Expand Up @@ -162,6 +164,7 @@ namespace QuantLib {
return ySize_;
}

QL_DEPRECATED_ENABLE_WARNING
}


Expand Down
17 changes: 4 additions & 13 deletions ql/patterns/composite.hpp
Expand Up @@ -30,21 +30,12 @@

namespace QuantLib {

//! %Composite pattern.
/*! The typical use of this class is:
\code
class CompositeFoo : public Composite<Foo> {
...
};
\endcode
which causes CompositeFoo to inherit from Foo and provides it
with methods for adding components. Of course, any abstract
Foo interface must still be implemented.
\ingroup patterns
/*! \deprecated To be removed as unused.
Copy it in your codebase if you need it.
Deprecated in version 1.26.
*/
template <class T>
class Composite : public T {
class QL_DEPRECATED Composite : public T {
protected:
std::list<ext::shared_ptr<T> > components_;
void add(const ext::shared_ptr<T>& c) { components_.push_back(c); }
Expand Down
12 changes: 4 additions & 8 deletions ql/termstructures/yield/drifttermstructure.hpp
Expand Up @@ -31,15 +31,11 @@

namespace QuantLib {

//! Drift term structure
/*! Drift term structure for modelling the common drift term:
riskFreeRate - dividendYield - 0.5*vol*vol
\note This term structure will remain linked to the original
structures, i.e., any changes in the latters will be
reflected in this structure as well.
/*! \deprecated To be removed as unused.
Copy it in your codebase if you need it.
Deprecated in version 1.26.
*/
class DriftTermStructure : public ZeroYieldStructure {
class QL_DEPRECATED DriftTermStructure : public ZeroYieldStructure {
public:
DriftTermStructure(const Handle<YieldTermStructure>& riskFreeTS,
Handle<YieldTermStructure> dividendTS,
Expand Down
22 changes: 3 additions & 19 deletions tools/check_header.py
@@ -1,34 +1,18 @@
#!/usr/bin/python
#!/usr/bin/python -u

import os
import sys
import tempfile

errors = 0

for line in sys.stdin.readlines():
header = line.strip()

main = (
r"""
#include <%s>
int main() {
return 0;
}
"""
% header
)

fd, fname = tempfile.mkstemp(suffix=".cpp", dir=".", text=True)
os.write(fd, bytes(str(main).encode("utf-8")))
os.close(fd)

print("Checking %s" % header)
command = "g++ -c -Wno-unknown-pragmas -Wall -Werror -I. %s -o /dev/null" % fname
command = "g++ -c -Wno-unknown-pragmas -Wall -Werror -I. %s -o /dev/null" % header
code = os.system(command)
if code != 0:
print("Errors while checking %s" % header)
errors += 1

os.unlink(fname)

sys.exit(errors)

0 comments on commit 42bff33

Please sign in to comment.