1 // Copyright 2016 Klemens Morgenstern
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // For more information, see http://www.boost.org
9 #include <boost/predef.h>
11 #if (__cplusplus >= 201402L) || (BOOST_COMP_MSVC >= BOOST_VERSION_NUMBER(14,0,0))
13 #include <boost/config.hpp>
14 #include <boost/variant.hpp>
16 BOOST_SYMBOL_EXPORT
extern int unscoped_var
;
17 int unscoped_var
= 42;
19 BOOST_SYMBOL_EXPORT
extern const double unscoped_c_var
;
20 const double unscoped_c_var
= 1.234;
23 namespace some_space
{
25 BOOST_SYMBOL_EXPORT
extern double variable
;
26 double variable
= 0.2;
27 BOOST_SYMBOL_EXPORT
const int & scoped_fun()
29 static int x
= 0xDEADBEEF;
36 BOOST_SYMBOL_EXPORT
void overloaded(const volatile int i
)
41 BOOST_SYMBOL_EXPORT
void overloaded(const double d
)
43 some_space::variable
= d
;
46 BOOST_SYMBOL_EXPORT
void use_variant(boost::variant
<int, double> & v
)
51 BOOST_SYMBOL_EXPORT
void use_variant(boost::variant
<double, int> & v
)
61 BOOST_SYMBOL_EXPORT
extern int father_value
;
62 int father_value
= 12;
64 struct BOOST_SYMBOL_EXPORT some_father
66 some_father() { father_value
= 24; };
67 ~some_father() { father_value
= 112; };
72 struct BOOST_SYMBOL_EXPORT some_class
: some_father
75 static void set_value(const int &i
);
77 // static some_class* dummy();
79 virtual double func(double i
, double j
);
80 virtual int func(int i
, int j
);
81 int func(int i
, int j
) volatile;
82 double func(double i
, double j
) const volatile;
89 some_class(some_class
&&);
92 some_class
& operator=(some_class
&&);
95 virtual ~some_class();
98 some_class::some_class(some_class
&&){}
101 some_class
& some_class::operator=(some_class
&&ref
) {return ref
;}
104 BOOST_SYMBOL_EXPORT
extern std::size_t size_of_some_class
;
105 std::size_t size_of_some_class
= sizeof(some_space::some_class
);
108 extern "C" BOOST_SYMBOL_EXPORT
const volatile some_class
* this_
;
109 const volatile some_class
* this_
= nullptr;
111 int some_class::value
= -1;
113 void some_class::set_value(const int &i
) {value
= i
;}
116 //some_class* some_class::dummy() {return new some_class();}//so it implements an allocating ctor.
118 double some_class::func(double i
, double j
) {this_
= this; return i
*j
;}
119 int some_class::func(int i
, int j
) {this_
= this; return i
+j
;}
120 int some_class::func(int i
, int j
) volatile {this_
= this; return i
-j
;;}
121 double some_class::func(double i
, double j
) const volatile {this_
= this; return i
/j
;}
123 int some_class::get() const {this_
= this; return mem_val
;}
124 void some_class::set(int i
) {this_
= this; mem_val
= i
;}
126 some_class::some_class() { this_
= this; value
= 23; mem_val
= 123;}
127 some_class::some_class(int i
) : mem_val(456) {this_
= this; value
= i
;}
129 some_class::~some_class()