First of all I should mention that traits are different things in C++/STL and languages like PHP, Lasso etc. It looks like the article from wikipedia refers to PHP-like traits because C++/STL traits are not designed for polymorphic reuse (we are speaking about code reuse with polymorphic behavior, right?). They designed to simplify declaration of template classes.
Traits are used in some languages that don't support multiple inheritance (PHP, Lasso etc). Traits allow to "emulate" multiple inheritance (but multiple inheritance and traits are not exactly the same).
In contrast C++ doesn't support PHP-traits but supports multiple inheritance. So if speaking about C++ then trait-like solution will be something like this:
class VisibleTrait
{
public:
virtual void draw();
};
class SolidTrait
{
public:
virtual void collide(Object objects[]);
};
class MovableTrait
{
public:
virtual void update();
};
// A player is visible, movable, and solid
class Player : public VisibleTrait, MovableTrait, SolidTrait
{
};
// Smoke is visible and movable but not solid
class Smoke : public VisibleTrait, MovableTrait
{
};
// A hause is visible and solid but not movable
class House : public VisibleTrait, SolidTrait
{
};
So to answer your question
How would one go about using traits to avoid forwarding functions with composition?
1) Traits don't avoid forwarding functions with composition because traits work independently from composition. (The article from Wikipadia is misleading a little regarding the relationship between traits and composition)
2) PHP/Lasso-like traits can be partially emulated in C++ with multiple inheritance.