Questions tagged [circular-reference]

A circular reference is a series of references where the last object references the first, resulting in a closed loop.

A circular reference is a series of references where the last object references the first, resulting in a closed loop.

Circular references can appear in computer programming when one piece of code requires the result from another, but that code needs the result from the first.

Information is taken from Wikipedia, more information available there.

758 questions
-1
votes
1 answer

C++ circular header includes - how can I solve this type?

I implemented a visitor design pattern. I want to eliminate the circular header includes. The code below is working, g++ compile it. I have a file: Classes.h It has base and derived class declaration, also has Classes.cpp with the definitions of…
-1
votes
1 answer

How to Resolve Circular Reference in Header File

I have the following header file (simplified for illustration here): #include class Box; class Item { int row; int column; Box *box; public: Item(Box *b) : box(b) {} void thiswontcompile() { box->dosomething(); } void…
ghborrmann
  • 101
  • 6
-1
votes
1 answer

How to resolve "Type circularly references itself error"?

What follows is an example of issue with an expected outcome: const actionTypes = { name: { set: "name/set", }, } as const; type ActionTypes = { [key: string]: (string | ActionTypes) }; //record value is string or ActionTypes //…
Mateja Petrovic
  • 3,799
  • 4
  • 25
  • 40
-1
votes
1 answer

Strange circular dependency in Symfony 5

I am having a problem with Symfony 5 and its Circular Dependency detection mechanism. I have defined the following class namespace App\HTSC\Entity\Finance\Subscription; /** * Category */ class Category { /** * @var string */ …
hatemp
  • 61
  • 1
  • 7
-1
votes
2 answers

Concept about Reference Count and Circular Reference in C++

I known how weak_ptr is used, I read the following post: About “circular reference”, I used weak_ptr but memory leak still happened But there is a concept I can't understand yet. I will demonstrate shared_ptr's created and released as I understand…
curlywei
  • 682
  • 10
  • 18
-1
votes
1 answer

How to catch an error with try/catch in JSON.stringify with replacer?

I have an error in my app: JSON.stringify cannot serialize cyclic structures. And I need to catch it. For it, I decided to override the JSON.stringify method with replacer that prints in the console the object with a circular reference like…
jocoders
  • 1,594
  • 2
  • 19
  • 54
-1
votes
1 answer

Circular reference - break on single reference

TL;DR Is there any way to create a weak reference that will call a callback upon having 1 strong reference left instead of 0? For those who think it's an X Y problem, here's the long explanation: I have quite a challenging issue that I'm trying to…
-1
votes
1 answer

python circular importing in the first line?

Let's say I have 2 python script the first one: #X.py import Y a = 'list' print('finish') and the second one: #Y.py import X z = X.a print(z) Question 1: When I execute X.py first,there's nothing wrong with the code,but when I execute the Y.py…
-1
votes
1 answer

Detect loop in linked list

First, I should mention that I've already checked out and understood the most popular algorithm for detecting whether a linked list has a loop in it or not (talking about this How to detect a loop in a linked list? ) However, I tried implementing my…
-1
votes
1 answer

IE 11 Out Of StackSpace

I have a rather large web app mostly written and tested on chromium. While testing it on IE11 it works for a while but then throws Out of stack space, and Stack Overflow at line 0. It is offering literally no way of debugging the issue. Does…
PC3TJ
  • 852
  • 5
  • 16
-1
votes
1 answer

Excel increment own value (circular reference)

I'm working on a table that looks like this: Last Type | Today Type | N Days ------------------------------- Type1 | Type2 | 0 ------------------------------- Type1 | Type1 | 1 ------------------------------- Type2 | …
FT29
  • 11
-1
votes
5 answers

Circular reference between three classes

I have three classes and I have a circular reference between them. class A { public A() { B obj = new B(); } } class B { public B() { C obj = new C(); } } class C { public C() { A obj = new…
pchajer
  • 1,584
  • 2
  • 13
  • 25
-2
votes
1 answer

VBA select case statements with variable set as relative cell giving off circular reference error

I am looking to utilize the user defined formula below to create a variable (cell_val) that is compared across a number of select case statements to return a specific sumif function result. the only variable that changes in the sumif function given…
-2
votes
1 answer

C# Circular reference. System.Text.Json.JsonException: A possible object cycle was detected .NET 5

I have created an API that is returning an object A, containing object B and object B is containing object A, see example below: public class Person() { string Name {get;set;} List Schemas {get;set;} } public class Schema(){ …
Antfolkarn
  • 101
  • 5
-2
votes
1 answer

Deep copy a recursive list in Java with circular references

I have the class: public class Node { private String id; private List children; } I need to create a deep copy of a List of it List, but given that there might circular references I was trying implementing the Cloneable interface and…
zepol
  • 187
  • 5
  • 20
1 2 3
50
51