1// Licensed to the .NET Foundation under one or more agreements.
2// The .NET Foundation licenses this file to you under the MIT license.
3// See the LICENSE file in the project root for more information.
4
5
6#ifndef __HOLDERINST_H_
7#define __HOLDERINST_H_
8
9// This file contains holder instantiations which we can't put in holder.h because
10// the instantiations require _ASSERTE to be defined, which is not always the case
11// for placed that include holder.h.
12
13FORCEINLINE void SafeArrayRelease(SAFEARRAY* p)
14{
15 SafeArrayDestroy(p);
16}
17
18
19class SafeArrayHolder : public Wrapper<SAFEARRAY*, SafeArrayDoNothing, SafeArrayRelease, NULL>
20{
21public:
22 SafeArrayHolder(SAFEARRAY* p = NULL)
23 : Wrapper<SAFEARRAY*, SafeArrayDoNothing, SafeArrayRelease, NULL>(p)
24 {
25 }
26
27 FORCEINLINE void operator=(SAFEARRAY* p)
28 {
29 Wrapper<SAFEARRAY*, SafeArrayDoNothing, SafeArrayRelease, NULL>::operator=(p);
30 }
31};
32
33#endif // __HOLDERINST_H_
34