   private func resolve(container: DependencyContainer) throws -> T? {
     let resolved: T?
     if required {
-      resolved = try container.resolve(tag: tag, builder: { (factory: () throws -> T) in try factory() }) as T
+      resolved = try container.resolve(tag: tag) as T
     }
     else {
-      resolved = try? container.resolve(tag: tag, builder: { (factory: () throws -> T) in try factory() }) as T
+      resolved = try? container.resolve(tag: tag) as T
     }
     return resolved
   }

 - seealso: `InjectedWeak`

*/
public final class Injected<T>: _InjectedPropertyBox<T>, _AnyInjectedPropertyBox {
  
  var _value: Any? = nil {
    didSet {
      if let value = value { didInject(value) }
    }
  }
  
  ///Wrapped value.
  public var value: T? {
    return _value as? T
  }

  /**

  
}

/**
 Implement this protocol if you want to use your own type to wrap auto-injected properties
 instead of using `Injected<T>` or `InjectedWeak<T>` types.
 
 **Example**:
 ```swift
 class MyCustomBox<T> {
   private(set) var value: T?
   init() {}
 }
 
 extension MyCustomBox: AutoInjectedPropertyBox {
   static var wrappedType: Any.Type { return T.self }
 
   func resolve(container: DependencyContainer) throws {
     value = try container.resolve() as T
   }
 }
 ```

*/
public protocol AutoInjectedPropertyBox: class {
  ///Should return type of the property that this box wraps
  static var wrappedType: Any.Type { get }
  
  /**
   Will be called by `DependencyContainer` during processing resolved instance properties.

   In this method you should resolve the instance that the box wraps and store a reference to it.
   
  -note: This method is not intended to be called manually, 
         `DependencyContainer` will call it for you.
   */
  func resolve(container: DependencyContainer) throws
}

