Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Warning (level 1) C4688

Error Message

'constraint': constraint list contains assembly private type 'type'

A constraint list has an assembly private type, meaning it will not be available when the type is accessed from outside the assembly. For more information, see Generics (Visual C++).

Example

The following sample generates C4688.

// C4688.cpp
// compile with: /clr /c /W1
ref struct A {};   // private type
public ref struct B {};

// Delete the following 3 lines to resolve.
generic <class T> 
where T : A   // C4688
public ref struct M {};

generic <class T> 
where T : B
public ref struct N {};

Community Additions

ADD
Show:
© 2015 Microsoft