Skip to content

Commit 6fa52bc

Browse files
committed
pair added
1 parent b9884a3 commit 6fa52bc

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

include/nbl/builtin/hlsl/pair.hlsl

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Copyright (C) 2025 - DevSH Graphics Programming Sp. z O.O.
2+
// This file is part of the "Nabla Engine".
3+
// For conditions of distribution and use, see copyright notice in nabla.h
4+
#ifndef _NBL_BUILTIN_HLSL_PAIR_INCLUDED_
5+
#define _NBL_BUILTIN_HLSL_PAIR_INCLUDED_
6+
7+
#include "nbl/builtin/hlsl/type_traits.hlsl"
8+
9+
namespace nbl
10+
{
11+
namespace hlsl
12+
{
13+
14+
template<typename T1, typename T2>
15+
struct pair
16+
{
17+
using first_type = T1;
18+
using second_type = T2;
19+
20+
first_type first;
21+
second_type second;
22+
};
23+
24+
25+
// Helper to make a pair (similar to std::make_pair)
26+
template<typename T1, typename T2>
27+
pair<T1, T2> make_pair(T1 f, T2 s)
28+
{
29+
pair<T1, T2> p;
30+
p.first = f;
31+
p.second = s;
32+
return p;
33+
}
34+
35+
}
36+
}
37+
38+
#endif

0 commit comments

Comments
 (0)