Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 797 Bytes

compiler-error-c3297.md

File metadata and controls

28 lines (22 loc) · 797 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3297
Compiler Error C3297
11/04/2016
C3297
C3297
2a718b4c-6cdb-4418-92c0-fc3a259431c4

Compiler Error C3297

'constraint_2' : cannot use 'constraint_1' as a constraint because 'constraint_1' has the value constraint

Value classes are sealed. If a constraint is a value class, another constraint can never derive from it.

For more information, see Constraints on Generic Type Parameters (C++/CLI).

Example

The following sample generates C3297.

// C3297.cpp
// compile with: /clr /c
generic<class T, class U>
where T : value class
where U : T   // C3297
public ref struct R {};