Skip to content

Commit 0df1b75

Browse files
authored
std::out_of_range doesn't have a default constructor (#378)
1 parent 3b00327 commit 0df1b75

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

AnnService/inc/Core/Common/KNearestNeighborhoodGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace SPTAG
2020
for (int j = 0; j < numResults && count < m_iNeighborhoodSize; j++) {
2121
const BasicResult& item = queryResults[j];
2222
if (item.VID < 0) break;
23-
IF_DEBUG(if (item.VID >= index->GetNumSamples()) throw std::out_of_range();)
23+
IF_DEBUG(if (item.VID >= index->GetNumSamples()) throw std::out_of_range("VID: "s + std::string(item->VID) + ", Samples: "s + std::string(index->GetNumSamples()));)
2424
if (item.VID == node) continue;
2525
nodes[count++] = item.VID;
2626
}

AnnService/inc/Core/Common/NeighborhoodGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ break;
553553
{
554554
BasicResult* item = query.GetResult(j);
555555
if (item->VID < 0) break;
556-
IF_DEBUG(if (item->VID >= index->GetNumSamples()) throw std::out_of_range();)
556+
IF_DEBUG(if (item->VID >= index->GetNumSamples()) throw std::out_of_range("VID: "s + std::string(item->VID) + ", Samples: "s + std::string(index->GetNumSamples()));)
557557
if (item->VID == node) continue;
558558

559559
InsertNeighbors(index, item->VID, node, item->Dist);

AnnService/inc/Core/Common/RelativeNeighborhoodGraph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace SPTAG
2020
for (int j = 0; j < numResults && count < m_iNeighborhoodSize; j++) {
2121
const BasicResult& item = queryResults[j];
2222
if (item.VID < 0) break;
23-
IF_DEBUG(if (item.VID >= index->GetNumSamples()) throw std::out_of_range();)
23+
IF_DEBUG(if (item.VID >= index->GetNumSamples()) throw std::out_of_range("VID: "s + std::string(item->VID) + ", Samples: "s + std::string(index->GetNumSamples()));)
2424
if (item.VID == node) continue;
2525

2626
bool good = true;

AnnService/src/Core/BKT/BKTIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ namespace SPTAG
279279
SizeType nn_index = node[i];
280280
if (nn_index < 0)
281281
break;
282-
IF_DEBUG(if (nn_index >= m_pSamples.R()) throw std::out_of_range(); )
282+
IF_DEBUG(if (nn_index >= m_pSamples.R()) throw std::out_of_range("VID: "s + std::string(nn_index) + ", Samples: "s + std::string(m_pSamples.R())); )
283283
//IF_NDEBUG(if (nn_index >= m_pSamples.R()) continue; )
284284
if (p_space.CheckAndSet(nn_index)) continue;
285285
float distance2leaf = m_fComputeDistance(p_query.GetQuantizedTarget(), (m_pSamples)[nn_index], GetFeatureDim());

AnnService/src/Core/KDT/KDTIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ namespace SPTAG
215215
SizeType nn_index = node[i];
216216
if (nn_index < 0)
217217
break;
218-
IF_DEBUG(if (nn_index >= m_pSamples.R()) throw std::out_of_range(); )
218+
IF_DEBUG(if (nn_index >= m_pSamples.R()) throw std::out_of_range("VID: "s + std::string(nn_index) + ", Samples: "s + std::string(m_pSamples.R())); )
219219
//IF_NDEBUG(if (nn_index >= m_pSamples.R()) continue; )
220220
if (p_space.CheckAndSet(nn_index))
221221
continue;

0 commit comments

Comments
 (0)