Boost logo

Boost :

Subject: [boost] [concept_check] addable
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-04-19 17:02:08

Hello all,

Does this Addable concept definition make sense to you? Is there any error?

#include <boost/concept_check.hpp>

template<typename T>
struct Addable { // User-defined concept.
        return_type(x + y); // Check addition `T operator+(T x, T y)`.

    T x;
    T y;

    void return_type(T const&); // Used to check addition returns type `T`.

It's not making Sun's linker happy:

"/opt/sunstudio12.1/bin/CC" -g -library=stlport4 -features=tmplife
-features=tmplrefstatic -library=stlport4 -m64 -KPIC -o
-Bdynamic -lrt -Bstatic -Bdynamic

Undefined???first referenced
 symbol ??? in file
void Addable<int>::return_type(const int&)
ld: fatal: Symbol referencing errors. No output written to

But the error might also be somewhere else in the program that checks the
concept, I'm still debugging...

Thanks a lot.

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at