title: Shorthand for defining scala context bound in trait
body: <p>In scala abstract class, if you want to define a context bound, you can simply use, e.g. [T: ClassTag] in parameter, however this is not possible in trait:</p>
  
  <pre><code>trait Foo[T: ClassTag]
  
  Error:(11, 35) traits cannot have type parameters with context bounds `: ...' nor view bounds `&lt;% ...'
  trait Foo[T: ClassTag]
           ^
  </code></pre>
  
  <p>if you define:</p>
  
  <pre><code>trait Foo[T] {
  
    implicit def ctg: ClassTag[T] = implicitly[ClassTag[T]]
  }
  
  object Bar extends Foo[Int]
  </code></pre>
  
  <p>then any attempt to read ctg inside Bar will trigger a StackOverflowError, as the implicit parameter becomes tail-recursive.</p>
  
  <p>So what's the best way to allow ctg to be defined in a trait that automatically expose subclasses to context bound?</p>