#include <boost/asio/query.hpp>
#include <cassert>
struct prop
{
};
struct object
{
friend int query(const object&, prop) { return 123; }
};
namespace boost {
namespace asio {
template<>
struct is_applicable_property<object, prop>
{
static const bool value = true;
};
namespace traits {
template<>
struct query_free<object, prop>
{
static const bool is_valid = true;
static const bool is_noexcept = true;
typedef int result_type;
};
} } }
int main()
{
object o1 = {};
int result1 = boost::asio::query(o1, prop());
assert(result1 == 123);
(void)result1;
const object o2 = {};
int result2 = boost::asio::query(o2, prop());
assert(result2 == 123);
(void)result2;
}