473,549 Members | 2,726 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C++20: Technical Question on upcoming Modules

1 New Member
Suppose a module M has an exported method foo whose implementation uses class myclass and/or method mymethod that originiate in an unrelated module or header and the module doesn't export them . Also implemetation of this method foo is exported in the module M.https://speedtest.vet/

Can one import the module and use the function foo from another library doesn't import of either myclass or mymethod? Technically, one can use implementation that supplied by the module so it can work.

Why the question? Suppose I have a simple function foo that can be inlined (fully or not fully as it might call some other heavy methods but it will at least save unnecessary function call). However, to compile and inline it one needs to import an additional header or module and I want to minimize header-level dependencies.

So the question is in short, is it possible to use exported method whose implementation is also exported - yet my current module is unable to compile it due to dependencies issue? Or the implementation must not be exported in this case?

Edit: from the replies it is understood the classification of "visible" and "reachable" methods/classes essentialy solve the issue. However, now I have another question: When ODR violation happens? When visible objects have identical names or even when reachable objects have the same name?

In similar note, consider diamond problem in modules. struct X is used by module A and module B yet none of them export it. Can module B use struct X generated by A? If yes, then suppose struct X is defined differently in A and B will it result in UB or a sensible compiler/linker error?
Apr 9 '20 #1
0 1474

Sign in to post your reply or Sign up for a free account.

Similar topics

36
2594
by: Tim Churches | last post by:
If a compiled Python extension module B includes code from some other software A which is licensed only under the GPL, do other Python programmes, C, which import module B also need to be licensed under a GPL-compatible license (assuming C is/are to be distributed to third parties)? I think the answer is yes, both from a lay (IANAL) legal...
68
3705
by: Grant Edwards | last post by:
Let's say I use a GPL'd python module (e.g. something installed in site-packages) in an application. Let's also say I use py2exe to package and distribute said application. Is what I'm distributing a "derived work" of the GPL'd python? Or is py2exe's packaging of the module's .pyc file and my application code's .pyc files a "mere...
2
2030
by: James Buchanan | last post by:
Hi group, I'm preparing Python 2.4.2 for the upcoming Minix 3.x release, and I have problems with make. configure runs fine and creates the makefile, but right at the end ends with an error about a circular dependency in Modules/signalmodule.o. I'm new to makefiles and makefile rules, so I can understand what this means, but I don't...
1
2172
by: Jordan Bruce | last post by:
******************************************************* ONTARIO CANADA INFORMIX USER GROUP (OCIUG) http://www.iiug.org/ociug NEXT MEETING: WEDNESDAY, JULY 14 ******************************************************* Dear OCIUG member, Our next meeting is an all-day event this coming Wednesday, July 15 at the IBM training facility in...
0
2192
by: Nick White [MSFT] | last post by:
Hello fellow Microsoft Windows Mobile and Embedded enthusiasts: I invite you to peruse the list below of upcoming technical chats and Webcasts offered by the Windows Mobile and Embedded Devices Group. For the full list of upcoming Windows Mobile and Embedded chats, to review archived chat sessions, or to request a reminder for a chat,...
12
1273
by: Morten Snedker | last post by:
I've read that modules in .Net are mainly for backwards compability. Is this true? If I have variables I want to be exposed to all classes (regular classes, forms etc), I'd find it natural to put these in a module and dimension them Public. Or is the proper way to do it differently?
11
3840
by: fortepianissimo | last post by:
Say I have the following package organization in a system I'm developing: A |----B |----C |----D I have a module, say 'foo', that both package D and B require. What is the best practice in terms of creating a 'common' package that hosts
5
2147
by: Aziz | last post by:
Hi, I've recently contacted technical service of a web hosting company and asked them wheter or not they're gonna upgrade to PHP5 and MySQL5. Here's a quote from their response which confused me a little: "As php5 and mysql5 are still beta versions we don't install beta versions on production servers due to secure reasons, we install only...
4
3143
by: wanwan | last post by:
Hi, I have a project with multiple c files. Some of these modules have functions that have the same name and their operations are exactly the same. My rusty memory tells me there is a way with preprocessor directives to make sure these functions are not included more than once, but I forgot how to.
173
5615
by: Zytan | last post by:
I've read the docs on this, but one thing was left unclear. It seems as though a Module does not have to be fully qualified. Is this the case? I have source that apparently shows this. Are modules left-over from VB6, and not much used anymore? It seems that it is better to require Imports or use fully qualified names for functions in...
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
766
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.